simplification
authorPierre Habouzit <madcoder@debian.org>
Tue, 27 Oct 2009 22:24:43 +0000 (23:24 +0100)
committerPierre Habouzit <madcoder@debian.org>
Tue, 27 Oct 2009 22:24:43 +0000 (23:24 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
config/awesome/rc.lua

index caa561e..d2ea01d 100644 (file)
@@ -311,14 +311,10 @@ globalkeys = awful.util.table.join(
 
     -- Mod+Shift_{E/D}: move window to next/prev screen
     awful.key(k_mc, "Right", function()
-       local s = mouse.screen + 1
-       while s > screen.count() do s = s - screen.count() end
-       client.focus.screen = s
+       client.focus.screen = awful.util.cycle(screen.count(), mouse.screen + 1)
     end),
     awful.key(k_mc, "Left", function()
-       local s = mouse.screen - 1
-       while s < 1 do s = s + screen.count() end
-       client.focus.screen = s
+       client.focus.screen = awful.util.cycle(screen.count(), mouse.screen - 1)
     end),