Created
June 11, 2012 14:41
-
-
Save alexander-yakushev/2910397 to your computer and use it in GitHub Desktop.
Fix move_to_screen in AwesomeWM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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