summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-12-02 17:54:14 +0100
committerAnton Khirnov <anton@khirnov.net>2020-12-02 17:54:14 +0100
commit0dcfdb0b6bbc7afc38141a2c6c4c5d7201ca4c7b (patch)
treef1e2794d072e25c8fba218250d2c324442ad7b00
parent9d9fabb0121ec288f4dc033275909ff278e696e6 (diff)
bindings: add bindings to swap contents of two desks
-rw-r--r--bindings.lua32
1 files changed, 32 insertions, 0 deletions
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()