summaryrefslogtreecommitdiff
path: root/workspace.lua
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-12-02 16:54:37 +0100
committerAnton Khirnov <anton@khirnov.net>2020-12-02 16:54:37 +0100
commitce845ee2aa0efbfc0b8706e7933b1dff5749f24f (patch)
treed69f4ca88423e9ab0d8dd0f702c2e8b82f3dfc84 /workspace.lua
parent26d0f94af5075c631222dd8df71946535cba6eb3 (diff)
bindings: add bindings for moving clients between adjacent desktop pages
Diffstat (limited to 'workspace.lua')
-rw-r--r--workspace.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/workspace.lua b/workspace.lua
index f0a6dcc..cb0eff1 100644
--- a/workspace.lua
+++ b/workspace.lua
@@ -157,6 +157,16 @@ function Workspace:move_client(client, desk, page)
awful.client.movetotag(dst_page, client)
end
+function Workspace:client_move_relative(client, offset)
+ local state = self.screen_state[mouse.screen]
+ if state then
+ local desk = state.desktop_idx
+ local page = 1 + ((state.page_idx - 1 + offset) % #self.desktops[desk].pages)
+
+ self:move_client(client, desk, page)
+ end
+end
+
function Workspace:new(layouts)
local o = setmetatable({}, self)
self.__index = self