summaryrefslogtreecommitdiff
path: root/workspace.lua
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-02-07 17:13:29 +0100
committerAnton Khirnov <anton@khirnov.net>2017-02-07 17:13:29 +0100
commitf57f42d2e86d3c44b662ea0f587fb74d3f85ff4b (patch)
tree9734688c84b4e1b589df1c8ceb37bc5bc3a0572b /workspace.lua
parent2502443f979a3efd073b2278734ec394fae3bfaf (diff)
Add functionality for desktop renaming.
Diffstat (limited to 'workspace.lua')
-rw-r--r--workspace.lua14
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)