Focus screen relative to focused window, not mouse

This commit is contained in:
Tom Willemse 2015-04-08 15:13:01 +02:00
parent 41968ee029
commit fb1066f5e0

View file

@ -62,6 +62,10 @@ function shrink_to_picturefix_width()
client.focus:geometry({x = g.x, y = g.y, width = 1066, height = 1060}) client.focus:geometry({x = g.x, y = g.y, width = 1066, height = 1060})
end end
function oni_focus_relative(i)
return awful.screen.focus(awful.util.cycle(screen.count(), client.focus.screen + i))
end
-- {{{ Error handling -- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to -- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config) -- another config (This code will only ever execute for the fallback config)
@ -365,8 +369,8 @@ globalkeys = awful.util.table.join(
-- Layout manipulation -- Layout manipulation
awful.key({ modkey, "Shift" }, "n", function () awful.client.swap.byidx( 1) end), 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, "Shift" }, "p", function () awful.client.swap.byidx( -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 () awful.screen.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) end),
awful.key({ modkey, "Shift" }, ",", function () awful.client.movetoscreen(client.focus, -1) end), awful.key({ modkey, "Shift" }, ",", function () awful.client.movetoscreen(client.focus, -1) end),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "u", awful.client.urgent.jumpto),