With sx-bind, you can bind keystrokes to actions. Its plugin key is “bind”.
sx-bind depends on sx-actions.
There is just one parameter that sx-bind provides in its parameter dictionary: ‘screen’ is the samuraix.screen.Screen object the keystroke was pressed on.
A dictionary connecting Keystrokes to action lines.
Example:
'bind.keys': {
'Meta+n': 'desktops.cycle offset=1',
'Meta+p': 'desktops.cycle offset=-1',
'Meta+c': 'desktops.cycle_clients',
'Meta+d': 'log message="pressed d"',
'Meta+Q': 'quit',
'Ctrl+R': 'restart',
'Meta+L': 'layoutmgr.cycle',
}
A keystroke describes a combination of modifier keys and one normal key pressed. They are joined together by a “+” char. The modifiers are case-insensitive, the key is not.
Valid modifier names are: ‘alt’, ‘numlock’, ‘meta’, ‘altgr’, ‘shift’, ‘lock’, ‘ctrl’, ‘control’, ‘mod1’, ‘mod2’, ‘mod3’, ‘mod4’, ‘mod5’.
The valid key values are listed in the ooxcb documentation.
Examples:
# the following three keystrokes are equal
Meta+n
META+n
mEtA+n
# some more examples
SHIFT+metA+0
Ctrl+alt+Delete
Return (modifiers, keysym), extracted from the string s.
It has to contain several modifiers and keysym names, joined together with a ‘+’:
CTRL+A
MOD4+q