Skip to content

Instantly share code, notes, and snippets.

@alexander-yakushev
Created June 11, 2012 14:41
Show Gist options
  • Save alexander-yakushev/2910397 to your computer and use it in GitHub Desktop.
Save alexander-yakushev/2910397 to your computer and use it in GitHub Desktop.
Fix move_to_screen in AwesomeWM
function smart_movetoscreen(c, s)
local was_maximized = { h = false, v = false }
if c.maximized_horizontal then
c.maximized_horizontal = false
was_maximized.h = true
end
if c.maximized_vertical then
c.maximized_vertical = false
was_maximized.v = true
end
local sel = c or client.focus
if sel then
local sc = screen.count()
if not s then
s = sel.screen + 1
end
if s > sc then s = 1 elseif s < 1 then s = sc end
sel.screen = s
mouse.coords(screen[s].geometry)
end
if was_maximized.h then
c.maximized_horizontal = true
end
if was_maximized.v then
c.maximized_vertical = true
end
end
-- ........
clientkeys = awful.util.table.join(
-- ........
awful.key({ modkey, }, "o", smart_movetoscreen ),
-- ........
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment