Merge pull request #3027 from SethBarberee/hotkeys_widget_doc_example

Add example for hotkeys_popup.widget
This commit is contained in:
mergify[bot] 2020-03-07 03:11:27 +00:00 committed by GitHub
commit 0dfa5930b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 36 additions and 0 deletions

View File

@ -1,6 +1,42 @@
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Popup widget which shows current hotkeys and their descriptions. --- 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> -- @author Yauheni Kirylau <yawghen@gmail.com>
-- @copyright 2014-2015 Yauheni Kirylau -- @copyright 2014-2015 Yauheni Kirylau
-- @popupmod awful.hotkeys_popup.widget -- @popupmod awful.hotkeys_popup.widget