From 0dcfdb0b6bbc7afc38141a2c6c4c5d7201ca4c7b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 2 Dec 2020 17:54:14 +0100 Subject: bindings: add bindings to swap contents of two desks --- bindings.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bindings.lua b/bindings.lua index f9db2d7..3241a56 100644 --- a/bindings.lua +++ b/bindings.lua @@ -100,6 +100,38 @@ function M.create(workspace) end end), + -- swap two screens + awful.key({ modkey, "Mod1" }, "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 + end), + awful.key({ modkey, "Mod1" }, "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 + end), + awful.key({ modkey, "Mod1" }, "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 + end), + -- Prompt awful.key({ modkey }, "n", function() -- cgit v1.2.3