mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-27 12:08:49 +02:00
bindings: make mouse follow focused window
This only happens if we change window focus using key bindings.
This commit is contained in:
parent
ec5d1683c1
commit
a2451c2a04
1 changed files with 27 additions and 4 deletions
|
@ -87,18 +87,34 @@ local toggle_pidgin = toggle_window(
|
||||||
-- Toggle urgent window
|
-- Toggle urgent window
|
||||||
local toggle_urgent = toggle_window(awful.client.urgent.get)
|
local toggle_urgent = toggle_window(awful.client.urgent.get)
|
||||||
|
|
||||||
|
-- Move mouse to the top left corner of the currently focused client
|
||||||
|
local function move_mouse()
|
||||||
|
if client.focus and client.focus.screen == mouse.screen then
|
||||||
|
local _, x, y = awful.mouse.client.corner(nil, "top_left")
|
||||||
|
if x and y then
|
||||||
|
mouse.coords({ x = x, y = y }, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
config.keys.global = awful.util.table.join(
|
config.keys.global = awful.util.table.join(
|
||||||
keydoc.group("Focus"),
|
keydoc.group("Focus"),
|
||||||
awful.key({ modkey, }, "j",
|
awful.key({ modkey, }, "j",
|
||||||
function ()
|
function ()
|
||||||
awful.client.focus.byidx( 1)
|
awful.client.focus.byidx( 1)
|
||||||
if client.focus then client.focus:raise() end
|
if client.focus then
|
||||||
|
client.focus:raise()
|
||||||
|
move_mouse()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
"Focus next window"),
|
"Focus next window"),
|
||||||
awful.key({ modkey, }, "k",
|
awful.key({ modkey, }, "k",
|
||||||
function ()
|
function ()
|
||||||
awful.client.focus.byidx(-1)
|
awful.client.focus.byidx(-1)
|
||||||
if client.focus then client.focus:raise() end
|
if client.focus then
|
||||||
|
client.focus:raise()
|
||||||
|
move_mouse()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
"Focus previous window"),
|
"Focus previous window"),
|
||||||
awful.key({ modkey, }, "Tab",
|
awful.key({ modkey, }, "Tab",
|
||||||
|
@ -106,14 +122,21 @@ config.keys.global = awful.util.table.join(
|
||||||
awful.client.focus.history.previous()
|
awful.client.focus.history.previous()
|
||||||
if client.focus then
|
if client.focus then
|
||||||
client.focus:raise()
|
client.focus:raise()
|
||||||
|
move_mouse()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
"Focus previously focused window"),
|
"Focus previously focused window"),
|
||||||
awful.key({ modkey, }, "u", toggle_pidgin,
|
awful.key({ modkey, }, "u", toggle_pidgin,
|
||||||
"Toggle Pidgin conversation window"),
|
"Toggle Pidgin conversation window"),
|
||||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
awful.key({ modkey, "Control" }, "j", function ()
|
||||||
|
awful.screen.focus_relative( 1)
|
||||||
|
move_mouse()
|
||||||
|
end,
|
||||||
"Jump to next screen"),
|
"Jump to next screen"),
|
||||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
awful.key({ modkey, "Control" }, "k", function ()
|
||||||
|
awful.screen.focus_relative(-1)
|
||||||
|
move_mouse()
|
||||||
|
end),
|
||||||
|
|
||||||
keydoc.group("Layout manipulation"),
|
keydoc.group("Layout manipulation"),
|
||||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue