mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-15 12:44:21 +02:00
bindings: use own screen_focus
function that do not move the mouse after focusing the client
This allows a signal to put the mouse in the upper left corner of a newly focused window on another screen.
This commit is contained in:
parent
57a6917b5b
commit
315f902728
1 changed files with 10 additions and 2 deletions
|
@ -87,6 +87,14 @@ local toggle_pidgin = toggle_window(
|
|||
-- Toggle urgent window
|
||||
local toggle_urgent = toggle_window(awful.client.urgent.get)
|
||||
|
||||
-- Focus a relative screen (similar to `awful.screen.focus_relative`)
|
||||
local function screen_focus(i)
|
||||
local s = awful.util.cycle(screen.count(), mouse.screen + i)
|
||||
local c = awful.client.focus.history.get(s, 0)
|
||||
mouse.screen = s
|
||||
if c then client.focus = c end
|
||||
end
|
||||
|
||||
config.keys.global = awful.util.table.join(
|
||||
keydoc.group("Focus"),
|
||||
awful.key({ modkey, }, "j",
|
||||
|
@ -116,11 +124,11 @@ config.keys.global = awful.util.table.join(
|
|||
awful.key({ modkey, }, "u", toggle_pidgin,
|
||||
"Toggle Pidgin conversation window"),
|
||||
awful.key({ modkey, "Control" }, "j", function ()
|
||||
awful.screen.focus_relative( 1)
|
||||
screen_focus( 1)
|
||||
end,
|
||||
"Jump to next screen"),
|
||||
awful.key({ modkey, "Control" }, "k", function ()
|
||||
awful.screen.focus_relative(-1)
|
||||
screen_focus(-1)
|
||||
end),
|
||||
|
||||
keydoc.group("Layout manipulation"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue