Document ALL the keys

This commit is contained in:
Badel2 2017-10-12 02:09:48 +02:00
parent 79d28db32a
commit b712238491
1 changed files with 88 additions and 45 deletions

View File

@ -211,11 +211,12 @@ root.buttons(awful.util.table.join(
globalkeys = awful.util.table.join(
-- Take a screenshot
-- https://github.com/lcpz/dots/blob/master/bin/screenshot
awful.key({ altkey }, "p", function() os.execute("screenshot") end),
awful.key({ altkey }, "p", function() os.execute("screenshot") end,
{description = "take a screenshot", group = "hotkeys"}),
-- Hotkeys
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
{description = "show help", group="awesome"}),
-- Tag browsing
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
@ -249,22 +250,26 @@ globalkeys = awful.util.table.join(
function()
awful.client.focus.bydirection("down")
if client.focus then client.focus:raise() end
end),
end,
{description = "focus down", group = "client"}),
awful.key({ modkey }, "k",
function()
awful.client.focus.bydirection("up")
if client.focus then client.focus:raise() end
end),
end,
{description = "focus up", group = "client"}),
awful.key({ modkey }, "h",
function()
awful.client.focus.bydirection("left")
if client.focus then client.focus:raise() end
end),
end,
{description = "focus left", group = "client"}),
awful.key({ modkey }, "l",
function()
awful.client.focus.bydirection("right")
if client.focus then client.focus:raise() end
end),
end,
{description = "focus right", group = "client"}),
awful.key({ modkey, }, "w", function () awful.util.mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
@ -290,24 +295,32 @@ globalkeys = awful.util.table.join(
-- Show/Hide Wibox
awful.key({ modkey }, "b", function ()
for s in screen do
s.mywibox.visible = not s.mywibox.visible
if s.mybottomwibox then
s.mybottomwibox.visible = not s.mybottomwibox.visible
for s in screen do
s.mywibox.visible = not s.mywibox.visible
if s.mybottomwibox then
s.mybottomwibox.visible = not s.mybottomwibox.visible
end
end
end
end),
end,
{description = "toggle wibox", group = "awesome"}),
-- On the fly useless gaps change
awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end),
awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),
awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end,
{description = "increment useless gaps", group = "tag"}),
awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end,
{description = "decrement useless gaps", group = "tag"}),
-- Dynamic tagging
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end),
awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end),
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end), -- move to previous tag
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end), -- move to next tag
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end),
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end,
{description = "add new tag", group = "tag"}),
awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end,
{description = "rename tag", group = "tag"}),
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end,
{description = "move tag to the left", group = "tag"}),
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end,
{description = "move tag to the right", group = "tag"}),
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end,
{description = "delete tag", group = "tag"}),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
@ -346,65 +359,80 @@ globalkeys = awful.util.table.join(
{description = "restore minimized", group = "client"}),
-- Dropdown application
awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end),
awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end,
{description = "dropdown application", group = "launcher"}),
-- Widgets popups
awful.key({ altkey, }, "c", function () lain.widget.calendar.show(7) end),
awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end),
awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end),
awful.key({ altkey, }, "c", function () lain.widget.calendar.show(7) end,
{description = "show calendar", group = "widgets"}),
awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end,
{description = "show filesystem", group = "widgets"}),
awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end,
{description = "show weather", group = "widgets"}),
-- Brightness
awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 10") end),
awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 10") end),
awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 10") end,
{description = "+10%", group = "hotkeys"}),
awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 10") end,
{description = "-10%", group = "hotkeys"}),
-- ALSA volume control
awful.key({ altkey }, "Up",
function ()
os.execute(string.format("amixer -q set %s 1%%+", beautiful.volume.channel))
beautiful.volume.update()
end),
end,
{description = "volume up", group = "hotkeys"}),
awful.key({ altkey }, "Down",
function ()
os.execute(string.format("amixer -q set %s 1%%-", beautiful.volume.channel))
beautiful.volume.update()
end),
end,
{description = "volume down", group = "hotkeys"}),
awful.key({ altkey }, "m",
function ()
os.execute(string.format("amixer -q set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
beautiful.volume.update()
end),
end,
{description = "toggle mute", group = "hotkeys"}),
awful.key({ altkey, "Control" }, "m",
function ()
os.execute(string.format("amixer -q set %s 100%%", beautiful.volume.channel))
beautiful.volume.update()
end),
end,
{description = "volume 100%", group = "hotkeys"}),
awful.key({ altkey, "Control" }, "0",
function ()
os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel))
beautiful.volume.update()
end),
end,
{description = "volume 0%", group = "hotkeys"}),
-- MPD control
awful.key({ altkey, "Control" }, "Up",
function ()
awful.spawn.with_shell("mpc toggle")
beautiful.mpd.update()
end),
end,
{description = "mpc toggle", group = "widgets"}),
awful.key({ altkey, "Control" }, "Down",
function ()
awful.spawn.with_shell("mpc stop")
beautiful.mpd.update()
end),
end,
{description = "mpc stop", group = "widgets"}),
awful.key({ altkey, "Control" }, "Left",
function ()
awful.spawn.with_shell("mpc prev")
beautiful.mpd.update()
end),
end,
{description = "mpc prev", group = "widgets"}),
awful.key({ altkey, "Control" }, "Right",
function ()
awful.spawn.with_shell("mpc next")
beautiful.mpd.update()
end),
end,
{description = "mpc next", group = "widgets"}),
awful.key({ altkey }, "0",
function ()
local common = { text = "MPD widget ", position = "top_middle", timeout = 2 }
@ -416,16 +444,21 @@ globalkeys = awful.util.table.join(
common.text = common.text .. lain.util.markup.bold("ON")
end
naughty.notify(common)
end),
end,
{description = "mpc on/off", group = "widgets"}),
-- Copy primary to clipboard (terminals to gtk)
awful.key({ modkey }, "c", function () awful.spawn("xsel | xsel -i -b") end),
awful.key({ modkey }, "c", function () awful.spawn("xsel | xsel -i -b") end,
{description = "copy terminal to gtk", group = "hotkeys"}),
-- Copy clipboard to primary (gtk to terminals)
awful.key({ modkey }, "v", function () awful.spawn("xsel -b | xsel") end),
awful.key({ modkey }, "v", function () awful.spawn("xsel -b | xsel") end,
{description = "copy gtk to terminal", group = "hotkeys"}),
-- User programs
awful.key({ modkey }, "q", function () awful.spawn(browser) end),
awful.key({ modkey }, "a", function () awful.spawn(guieditor) end),
awful.key({ modkey }, "q", function () awful.spawn(browser) end,
{description = "run browser", group = "launcher"}),
awful.key({ modkey }, "a", function () awful.spawn(guieditor) end,
{description = "run gui editor", group = "launcher"}),
-- Default
--[[ Menubar
@ -436,7 +469,8 @@ globalkeys = awful.util.table.join(
awful.key({ modkey }, "x", function ()
awful.spawn(string.format("dmenu_run -i -fn 'Monospace' -nb '%s' -nf '%s' -sb '%s' -sf '%s'",
beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus))
end)
end,
{description = "show dmenu", group = "launcher"})
--]]
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
@ -456,7 +490,8 @@ globalkeys = awful.util.table.join(
)
clientkeys = awful.util.table.join(
awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client ),
awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client,
{description = "magnify client", group = "client"}),
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
@ -492,6 +527,14 @@ clientkeys = awful.util.table.join(
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
-- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
local descr_view, descr_toggle, descr_move, descr_toggle_focus
if i == 1 or i == 9 then
descr_view = {description = "view tag #", group = "tag"}
descr_toggle = {description = "toggle tag #", group = "tag"}
descr_move = {description = "move focused client to tag #", group = "tag"}
descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"}
end
globalkeys = awful.util.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
@ -502,7 +545,7 @@ for i = 1, 9 do
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
descr_view),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
@ -512,7 +555,7 @@ for i = 1, 9 do
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
descr_toggle),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
@ -523,7 +566,7 @@ for i = 1, 9 do
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
descr_move),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
@ -534,7 +577,7 @@ for i = 1, 9 do
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
descr_toggle_focus)
)
end