From cbb03d1a0df9a33e27a00a60660b60221f3c3b84 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 6 Mar 2020 07:09:29 -0600 Subject: [PATCH] add example for hotkeys_popup.widget --- lib/awful/hotkeys_popup/widget.lua | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index e8c598e0..90521caa 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -1,6 +1,42 @@ --------------------------------------------------------------------------- --- Popup widget which shows current hotkeys and their descriptions. -- +-- It's easy to add hotkeys for your favorite application. Below is how to add +-- hotkeys for firefox to the previously created `hotkeys_popup` in `rc.lua`. +-- +-- -- Create the rule that we will use to match for the application. +-- local fire_rule = { class = { "firefox", "Firefox" } } +-- for group_name, group_data in pairs({ +-- ["Firefox: tabs"] = { color = "#009F00", rule_any = fire_rule } +-- }) do +-- hotkeys_popup.add_group_rules(group_name, group_data) +-- end +-- +-- -- Table with all of our hotkeys +-- local firefox_keys = { +-- +-- ["Firefox: tabs"] = {{ +-- modifiers = { "Mod1" }, +-- keys = { +-- ["1..9"] = "go to tab" +-- } +-- }, { +-- modifiers = { "Ctrl" }, +-- keys = { +-- t = "new tab", +-- w = 'close tab', +-- ['Tab'] = "next tab" +-- } +-- }, { +-- modifiers = { "Ctrl", "Shift" }, +-- keys = { +-- ['Tab'] = "previous tab" +-- } +-- }} +-- } +-- +-- hotkeys_popup.add_hotkeys(firefox_keys) +-- -- @author Yauheni Kirylau <yawghen@gmail.com> -- @copyright 2014-2015 Yauheni Kirylau -- @popupmod awful.hotkeys_popup.widget