From b9db1d032a37e0a2f1501de6ef0e4acb6b645275 Mon Sep 17 00:00:00 2001 From: actionless Date: Sat, 17 Oct 2015 13:05:35 -0400 Subject: [PATCH] feat(awesomerc): add descriptions for some keybindings --- awesomerc.lua | 117 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 79 insertions(+), 38 deletions(-) diff --git a/awesomerc.lua b/awesomerc.lua index 3363430b7..7cc8afc6d 100755 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -227,47 +227,72 @@ root.buttons(awful.util.table.join( -- {{{ Key bindings globalkeys = awful.util.table.join( - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), + awful.key({ modkey, }, "Left", awful.tag.viewprev, + {description = "view previous", group = "tag"}), + awful.key({ modkey, }, "Right", awful.tag.viewnext, + {description = "view next", group = "tag"}), + awful.key({ modkey, }, "Escape", awful.tag.history.restore, + {description = "go back", group = "tag"}), awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) - end), + end, + {description = "focus next by index", group = "client"} + ), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) - end), - awful.key({ modkey, }, "w", function () mymainmenu:show() end), + end, + {description = "focus previous by index", group = "client"} + ), + awful.key({ modkey, }, "w", function () mymainmenu:show() end, + {description = "show main menu", group = "awesome"}), -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, + {description = "swap with next client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, + {description = "swap with previous client by index", group = "client"}), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, + {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, + {description = "focus the previous screen", group = "screen"}), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto, + {description = "jump to urgent client", group = "client"}), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end - end), + end, + {description = "go back", group = "client"}), -- Standard program - awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end), - awful.key({ modkey, "Control" }, "r", awesome.restart), - awful.key({ modkey, "Shift" }, "q", awesome.quit), + awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, + {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, "Control" }, "r", awesome.restart, + {description = "reload awesome", group = "awesome"}), + awful.key({ modkey, "Shift" }, "q", awesome.quit, + {description = "quit awesome", group = "awesome"}), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end), + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, + {description = "increase master width factor", group = "layout"}), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, + {description = "decrease master width factor", group = "layout"}), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, + {description = "increase the number of master clients", group = "layout"}), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, + {description = "decrease the number of master clients", group = "layout"}), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, + {description = "increase the number of columns", group = "layout"}), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, + {description = "decrease the number of columns", group = "layout"}), + awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, + {description = "select next", group = "layout"}), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, + {description = "select previous", group = "layout"}), awful.key({ modkey, "Control" }, "n", function () @@ -277,10 +302,12 @@ globalkeys = awful.util.table.join( client.focus = c c:raise() end - end), + end, + {description = "restore minimized", group = "client"}), -- Prompt - awful.key({ modkey }, "r", function () mypromptbox[awful.screen.focused()]:run() end), + awful.key({ modkey }, "r", function () mypromptbox[awful.screen.focused()]:run() end, + {description = "run prompt", group = "launcher"}), awful.key({ modkey }, "x", function () @@ -288,9 +315,11 @@ globalkeys = awful.util.table.join( mypromptbox[awful.screen.focused()].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") - end), + end, + {description = "lua execute prompt", group = "awesome"}), -- Menubar - awful.key({ modkey }, "p", function() menubar.show() end) + awful.key({ modkey }, "p", function() menubar.show() end, + {description = "show the menubar", group = "launcher"}) ) clientkeys = awful.util.table.join( @@ -299,22 +328,29 @@ clientkeys = awful.util.table.join( c.fullscreen = not c.fullscreen c:raise() end), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), - 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, "Shift" }, "c", function (c) c:kill() end, + {description = "close", group = "client"}), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , + {description = "toggle floating", group = "client"}), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, + {description = "move to master", group = "client"}), + awful.key({ modkey, }, "o", awful.client.movetoscreen , + {description = "move to screen", group = "client"}), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, + {description = "toggle keep on top", group = "client"}), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true - end), + end , + {description = "minimize", group = "client"}), awful.key({ modkey, }, "m", function (c) c.maximized = not c.maximized c:raise() - end) + end , + {description = "maximize", group = "client"}) ) -- Bind all key numbers to tags. @@ -330,7 +366,8 @@ for i = 1, 9 do if tag then awful.tag.viewonly(tag) end - end), + end, + {description = "view tag #"..i, group = "tag"}), -- Toggle tag. awful.key({ modkey, "Control" }, "#" .. i + 9, function () @@ -339,7 +376,8 @@ for i = 1, 9 do if tag then awful.tag.viewtoggle(tag) end - end), + end, + {description = "toggle tag #" .. i, group = "tag"}), -- Move client to tag. awful.key({ modkey, "Shift" }, "#" .. i + 9, function () @@ -349,7 +387,8 @@ for i = 1, 9 do awful.client.movetotag(tag) end end - end), + end, + {description = "move focused client to tag #"..i, group = "tag"}), -- Toggle tag. awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () @@ -359,7 +398,9 @@ for i = 1, 9 do awful.client.toggletag(tag) end end - end)) + end, + {description = "toggle focused client on tag #" .. i, group = "tag"}) + ) end clientbuttons = awful.util.table.join(