Add configurable custom hotkeys

This commit is contained in:
Alice Gaudon 2020-02-15 18:45:55 +01:00
parent abacea8562
commit e5d7c9a578
2 changed files with 26 additions and 3 deletions

View File

@ -119,6 +119,21 @@ config.keys.global_keys = {
}
}
-- Custom global hotkeys
config.keys.custom_keys = {
-- Example:
-- {
-- hotkey = {
-- { config.keys.modkey, },
-- "t"
-- },
-- action = function()
-- awful.spawn('terminator')
-- end,
-- identity = { description = "open terminator", group = "utilities" }
-- }
};
--
-- Widgets

View File

@ -351,8 +351,9 @@ root.buttons(gears.table.join(awful.button({}, 3, function() mymainmenu:toggle()
-- }}}
-- {{{ Key bindings
hotkey.registerKeys(awful.key({ config.keys.modkey, }, "s", hotkeys_popup.show_help,
{ description = "show help", group = "awesome" }),
hotkey.registerKeys(
awful.key({ config.keys.modkey, }, "s", hotkeys_popup.show_help,
{ description = "show help", group = "awesome" }),
awful.key({ config.keys.modkey, }, "Escape", awful.tag.history.restore,
{ description = "go back", group = "tag" }),
@ -448,7 +449,14 @@ hotkey.registerKeys(awful.key({ config.keys.modkey, }, "s", hotkeys_popup.show_h
{ description = "show the run menu", group = "launcher" }),
-- Flameshot
awful.key({}, "Print", function() os.execute(config.screenshot_utility_command) end,
{ description = "Take a screenshot using the screenshot utility", group = "utilities" }))
{ description = "Take a screenshot using the screenshot utility", group = "utilities" })
)
for key in gears.table.iterate(config.keys.custom_keys, function() return true end) do
hotkey.registerKeys(
hotkey.make(key.hotkey, key.action, key.identity)
)
end
clientkeys = gears.table.join(-- tiling
awful.key({ config.keys.modkey, }, "Right",