Custom Actions¶
The user may define a list of custom actions, which are shell commands bound to a specific key combination. These actions always have preference over those defined in Default Keybinds when they are bound to the same key combination.
Example¶
# ~/.config/miracle-wm/config.yaml
custom_actions: # Set meta + D to open wofi
- command: wofi --show=drun
action: down
modifiers:
- primary
key: d
Schema¶
A list of custom keybind actions:
custom_actions:
- command: <string>
action: <up|down|repeat|modifiers>
modifiers: <Modifier[]>
key: <KeysymName>
allow_on_lockscreen: <bool> # optional
Properties¶
command¶
-
required type: String
The shell command to execute when the keybind is triggered.
action¶
-
required type:
up|down|repeat|modifiersThe key action that triggers the command:
up— Triggered when the key is releaseddown— Triggered when the key is pressedrepeat— Triggered repeatedly while the key is heldmodifiers— Triggered when modifiers change
modifiers¶
-
required type: List of modifier keys
Modifier keys that must be held for the command to execute. Available modifiers:
Name Description primarythe key defined by the Action Key altAny alt key alt_leftThe left alt key only alt_rightThe right alt key only shiftAny shift key shift_leftThe left shift key only shift_rightThe right shift key only ctrlAny ctrl key ctrl_leftThe left ctrl key only ctrl_rightThe right ctrl key only metaThe superorwindowskeymeta_leftThe left superorwindowskey onlymeta_rightThe right superorwindowskey onlysymThe sym key functionThe fnkeycaps_lockThe caps lock key num_lockThe num lock key scroll_lockThe scroll lock key
key¶
-
required type: KeysymName
Name of the XKB keysym that the action responds to. See the xkbcommon keysym list for available names (e.g.,
Return,z,Up).For shifted characters, use the shifted keysym directly instead of combining a lowercase key with the
shiftmodifier. For example, useQinstead ofq+shift, and useexclaminstead of1+shift.
allow_on_lockscreen¶
-
optional type: Boolean default:
falseWhether the command may run while the session is locked. While the lock screen is up, every other key binding (including the Default Keybinds) is ignored and the key goes to the lock screen instead. This is useful for media, volume and brightness keys:
custom_actions: - command: wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ action: down modifiers: [] key: XF86AudioRaiseVolume allow_on_lockscreen: trueWarning
Anything bound with
allow_on_lockscreen: truecan be run by whoever is at the keyboard of a locked session. Never allow a command that unlocks the session, shows its contents or opens a shell.
Default¶
custom_actions: []