From fb1066f5e00249dfb28d8f2288c8f4fd1edf1b77 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 8 Apr 2015 15:13:01 +0200 Subject: [PATCH] Focus screen relative to focused window, not mouse --- awesome/.config/awesome/rc.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index 1a10a72..c832390 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -62,6 +62,10 @@ function shrink_to_picturefix_width() client.focus:geometry({x = g.x, y = g.y, width = 1066, height = 1060}) end +function oni_focus_relative(i) + return awful.screen.focus(awful.util.cycle(screen.count(), client.focus.screen + i)) +end + -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) @@ -365,8 +369,8 @@ globalkeys = awful.util.table.join( -- Layout manipulation awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "p", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, }, ".", function () awful.screen.focus_relative( 1) end), - awful.key({ modkey, }, ",", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, ".", function () oni_focus_relative( 1) end), + awful.key({ modkey, }, ",", function () oni_focus_relative(-1) end), awful.key({ modkey, "Shift" }, ".", function () awful.client.movetoscreen(client.focus) end), awful.key({ modkey, "Shift" }, ",", function () awful.client.movetoscreen(client.focus, -1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto),