bindings - MArpogaus/awesome GitHub Wiki

Description

This Module configures the mouse and key bindings.

Configuration

The definition of keybindings has been abstracted into two separate tables:

  • the keys table defines the "actual" keybindings
  • the actions table holds the function that should be triggered when the corresponding keys are pressed.

Keybindings can be separated in different modules. This allows easy modification and extension of keybindings.

Keybindings are configured in the bindings section of our config.lua and support the following parameters:

Name Description Type Default
altkey the alt key to use for key bindings string 'Mod1'
modkey the mod key to use for key bindings string 'Mod4'
keymaps the keybindings to load array {'default'}

The keymaps field inside config.luais used to load different keybinding modules.

It expects a list of keymap module names and searches for them first in ~/.config/awesome/config/key_bindings and then in ~/.config/awesome/rc/key_bindings. If no folder is found, it is ignored, without an error message. All the given modules are loaded and merged together, this allows you to overload or extend the keybindings easily.

This configuration comes with two sets of keybindings:

  • default keybindings taken from the stock rc.lua
  • extra keybindings to extend the default ones

Note: Make sure to load the extra keybindings after the default ones, otherwise all the default commands won't work: {'defaults', 'extra'}

Custom bindings

Do not alter the keybindings in the rc folder directly, instead put them in $HOME/.config/awesome/config. You can copy the default ones as a starting point:

cd $HOME/.config/awesome/
mkdir -p config/key_bindings/my_keys
cp rc/key_bindings/default/* config/key_bindings/my_keys

Then apply your changes and add 'my_keys' to key_bindings in your configuration file.

Note: Keybindings get merged, so you can omit everything defined inside the keybindings loaded beforehand i.e.: {'defaults', 'my_keys'} would extend / overload the default keys / actions.