summaryrefslogtreecommitdiff
path: root/bindings.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 /bindings.lua
parent2502443f979a3efd073b2278734ec394fae3bfaf (diff)
Add functionality for desktop renaming.
Diffstat (limited to 'bindings.lua')
-rw-r--r--bindings.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/bindings.lua b/bindings.lua
index 455a5fd..be43176 100644
--- a/bindings.lua
+++ b/bindings.lua
@@ -68,8 +68,6 @@ function M.create(workspace)
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
- awful.key({ modkey, "Control" }, "n", awful.client.restore),
-
-- Prompt
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
@@ -79,7 +77,19 @@ function M.create(workspace)
mypromptbox[mouse.screen].widget,
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
- end)
+ end),
+
+ awful.key({ modkey }, "n",
+ function()
+ awful.prompt.run({ prompt = "Rename desktop: " },
+ mypromptbox[mouse.screen].widget,
+ function(input)
+ if input then
+ local cur_desk = workspace.screen_state[mouse.screen].desktop
+ workspace:rename_desktop(cur_desk, input)
+ end
+ end)
+ end)
)
-- Bind all key numbers to tags.
@@ -117,7 +127,7 @@ function M.create(workspace)
function ()
local screen = mouse.screen
if workspace.desktops[i] == nil then
- workspace:add_desktop("Desktop " .. i, 10)
+ workspace:add_desktop(i, "Desktop " .. i, 10)
end
workspace:view(screen, i)
end),
@@ -137,7 +147,6 @@ function M.create(workspace)
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
awful.key({ modkey, }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal