diff options
Diffstat (limited to 'workspace.lua')
-rw-r--r-- | workspace.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/workspace.lua b/workspace.lua index 537345d..0ac91c3 100644 --- a/workspace.lua +++ b/workspace.lua @@ -6,12 +6,17 @@ local object = require("gears.object") local Workspace = {} -function Workspace:add_desktop(name, nb_pages) - idx = #self.desktops + 1 +function Workspace:add_desktop(idx, name, nb_pages) self.desktops[idx] = desktop.new(idx, name, nb_pages, self.layouts[1]) return idx end +function Workspace:rename_desktop(idx, name) + local desk = self.desktops[idx] + desk.name = name + desk:emit_signal("desktop:name", name) +end + function Workspace:_apply_state() orig_focus = mouse.screen @@ -105,7 +110,10 @@ end function Workspace:move_client(client, desk, page) print("move to " .. desk .. "/" .. page) - awful.client.movetotag(self.desktops[desk].pages[page], client) + local dst_page = self.desktops[desk].pages[page] + local dst_screen = awful.tag.getscreen(dst_page) + awful.client.movetoscreen(client, dst_screen) + awful.client.movetotag(dst_page, client) end function Workspace:new(layouts) |