Module: awful.hotkeys_popup.widget

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)

Info:

  • Copyright: 2014-2015 Yauheni Kirylau
  • Originally authored by: Yauheni Kirylau <yawghen@gmail.com>
    (Full contributors list available on our github project)

Constructors

awful.widget.hotkeys_popup.widget.new {[args]} Create an instance of widget with hotkeys help.

Static module functions

awful.hotkeys_popup.widget.show_help ([c[, s[, args]]]) Show popup with hotkeys help (default widget instance will be used).
awful.hotkeys_popup.widget.add_hotkeys (hotkeys) Add hotkey descriptions for third-party applications (default widget instance will be used).
awful.hotkeys_popup.widget.add_group_rules (group, data) Add hotkey group rules for third-party applications (default widget instance will be used).

Object methods

:show_help ([c[, s[, show_args]]]) Show popup with hotkeys help.
:add_hotkeys (hotkeys) Add hotkey descriptions for third-party applications.
:add_group_rules (group, data) Add hotkey group rules for third-party applications.

Theme variables

beautiful.hotkeys_bg color Hotkeys widget background color.
beautiful.hotkeys_fg color Hotkeys widget foreground color.
beautiful.hotkeys_border_width int Hotkeys widget border width.
beautiful.hotkeys_border_color color Hotkeys widget border color.
beautiful.hotkeys_shape gears.shape Hotkeys widget shape.
beautiful.hotkeys_modifiers_fg color Foreground color used for hotkey modifiers (Ctrl, Alt, Super, etc).
beautiful.hotkeys_label_bg color Background color used for miscellaneous labels of hotkeys widget.
beautiful.hotkeys_label_fg color Foreground color used for hotkey groups and other labels.
beautiful.hotkeys_font string or lgi.Pango.FontDescription Main hotkeys widget font.
beautiful.hotkeys_description_font string or lgi.Pango.FontDescription Font used for hotkeys' descriptions.
beautiful.hotkeys_group_margin int Margin between hotkeys groups.

Fields

awful.hotkeys_popup.widget.widget.hide_without_description boolean Don't show hotkeys without descriptions.
awful.hotkeys_popup.widget.widget.merge_duplicates boolean Merge hotkey records into one if they have the same modifiers and description.


Constructors

awful.widget.hotkeys_popup.widget.new {[args]}
Create an instance of widget with hotkeys help.

Parameters:

  • args Configuration options for the widget.
    • hide_without_description boolean Don't show hotkeys without descriptions. (optional)
    • merge_duplicates boolean Merge hotkey records into one if they have the same modifiers and description. Records with five keys or more will abbreviate them. (optional)
    • width int Widget width. (optional)
    • height int Widget height. (optional)
    • bg color Widget background color. (optional)
    • fg color Widget foreground color. (optional)
    • border_width int Border width. (optional)
    • border_color color Border color. (optional)
    • shape gears.shape Widget shape. (optional)
    • font string or lgi.Pango.FontDescription Main widget font. (optional)
    • description_font string or lgi.Pango.FontDescription Font used for hotkeys' descriptions. (optional)
    • modifiers_fg color Foreground color used for hotkey modifiers (Ctrl, Alt, Super, etc). (optional)
    • label_bg color Background color used for miscellaneous labels. (optional)
    • label_fg color Foreground color used for group and other labels. (optional)
    • group_margin int Margin between hotkeys groups. (optional)
    • labels table Labels used for displaying human-readable keynames. (optional)
    • group_rules table Rules for showing 3rd-party hotkeys. @see awful.hotkeys_popup.keys.vim. (optional)

Returns:

    Widget instance.

Static module functions

awful.hotkeys_popup.widget.show_help ([c[, s[, args]]])
Show popup with hotkeys help (default widget instance will be used).

Parameters:

  • c client Client. (optional)
  • s screen Screen. (optional)
  • args Additional arguments.
    • show_awesome_keys boolean Show AwesomeWM hotkeys. When set to false only app-specific hotkeys will be shown. (default true)
awful.hotkeys_popup.widget.add_hotkeys (hotkeys)
Add hotkey descriptions for third-party applications (default widget instance will be used).

Parameters:

  • hotkeys table Table with bindings, see awful.hotkeys_popup.key.vim as an example.
awful.hotkeys_popup.widget.add_group_rules (group, data)
Add hotkey group rules for third-party applications (default widget instance will be used).

Parameters:

  • group string rule group name,
  • data table rule data for the group see awful.hotkeys_popup.key.vim as an example.

Object methods

:show_help ([c[, s[, show_args]]])
Show popup with hotkeys help.

Parameters:

  • c client Client. (optional)
  • s screen Screen. (optional)
  • show_args Additional arguments.
    • show_awesome_keys boolean Show AwesomeWM hotkeys. When set to false only app-specific hotkeys will be shown. (default true)
:add_hotkeys (hotkeys)
Add hotkey descriptions for third-party applications.

Parameters:

  • hotkeys table Table with bindings, see awful.hotkeys_popup.key.vim as an example.
:add_group_rules (group, data)
Add hotkey group rules for third-party applications.

Parameters:

  • group string hotkeys group name,
  • data table rule data for the group see awful.hotkeys_popup.key.vim as an example.

Theme variables

beautiful.hotkeys_bg color
Hotkeys widget background color.
beautiful.hotkeys_fg color
Hotkeys widget foreground color.
beautiful.hotkeys_border_width int
Hotkeys widget border width.
beautiful.hotkeys_border_color color
Hotkeys widget border color.
beautiful.hotkeys_shape gears.shape
Hotkeys widget shape.

See also:

beautiful.hotkeys_modifiers_fg color
Foreground color used for hotkey modifiers (Ctrl, Alt, Super, etc).
beautiful.hotkeys_label_bg color
Background color used for miscellaneous labels of hotkeys widget.
beautiful.hotkeys_label_fg color
Foreground color used for hotkey groups and other labels.
beautiful.hotkeys_font string or lgi.Pango.FontDescription
Main hotkeys widget font.
beautiful.hotkeys_description_font string or lgi.Pango.FontDescription
Font used for hotkeys' descriptions.
beautiful.hotkeys_group_margin int
Margin between hotkeys groups.

Fields

awful.hotkeys_popup.widget.widget.hide_without_description boolean
Don't show hotkeys without descriptions.
awful.hotkeys_popup.widget.widget.merge_duplicates boolean
Merge hotkey records into one if they have the same modifiers and description. Records with five or more keys will abbreviate them.

This property only affects hotkey records added via awful.key keybindings. Cheatsheets for external programs are static and will present merged records regardless of the value of this property.

generated by LDoc 1.4.6 Last updated 2021-11-13 00:35:50