summaryrefslogtreecommitdiff
path: root/bindings.lua
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-10-26 18:52:13 +0200
committerAnton Khirnov <anton@khirnov.net>2021-10-26 18:52:13 +0200
commit871204a041cddf127149ef8e5fd1d5eb54784f51 (patch)
treec0148a959043fc2da28fad54be4d915233e1c605 /bindings.lua
parent6866499f3561ae5a9f3939abd6102710676baada (diff)
bindings: factor out swapping two screens
Diffstat (limited to 'bindings.lua')
-rw-r--r--bindings.lua36
1 files changed, 3 insertions, 33 deletions
diff --git a/bindings.lua b/bindings.lua
index 087e4c3..e1b68c8 100644
--- a/bindings.lua
+++ b/bindings.lua
@@ -140,39 +140,9 @@ function M.create(workspace)
end),
-- swap two screens
- awful.key({ modkey, "Control" }, "q",
- function ()
- local screen_dst = mouse.screen
- local screen_src = utils.screen_physical(1)
- if screen_src ~= screen_dst then
- local desk_idx = workspace.screen_state[screen_src].desktop_idx
- local page_idx = workspace.screen_state[screen_src].page_idx
- workspace:view(screen_dst, desk_idx, page_idx)
- end
- timer.delayed_call(awful.screen.focus, screen_src)
- end),
- awful.key({ modkey, "Control" }, "w",
- function ()
- local screen_dst = mouse.screen
- local screen_src = utils.screen_physical(2)
- if screen_src ~= screen_dst then
- local desk_idx = workspace.screen_state[screen_src].desktop_idx
- local page_idx = workspace.screen_state[screen_src].page_idx
- workspace:view(screen_dst, desk_idx, page_idx)
- end
- timer.delayed_call(awful.screen.focus, screen_src)
- end),
- awful.key({ modkey, "Control" }, "e",
- function ()
- local screen_dst = mouse.screen
- local screen_src = utils.screen_physical(3)
- if screen_src ~= screen_dst then
- local desk_idx = workspace.screen_state[screen_src].desktop_idx
- local page_idx = workspace.screen_state[screen_src].page_idx
- workspace:view(screen_dst, desk_idx, page_idx)
- end
- timer.delayed_call(awful.screen.focus, screen_src)
- end),
+ awful.key({ modkey, "Control" }, "q", function() workspace:swap_screens(1) end),
+ awful.key({ modkey, "Control" }, "w", function() workspace:swap_screens(2) end),
+ awful.key({ modkey, "Control" }, "e", function() workspace:swap_screens(3) end),
-- Prompt
awful.key({ modkey }, "n",