Files
dwl-patches/patches/chainkeys/README.md
T
2026-10-02 11:06:30 -07:00

25 lines
1.4 KiB
Markdown

### Description
Implements chained keybindings (like the dwm
[keychain](https://dwm.suckless.org/patches/keychain/) patch).
Bindings can share a leading chain key. This chain key will be triggered when
Mod+chain is pressed. A subsequent keypress will be matched against bindings
for that chain key. If it is configured the action will be triggered, otherwise
the keypress will be ignored.
To use chainkeys, append the key after the argument in the keybindings. Example usage:
```c
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_s, setmfact, {.f = -0.05f}, XKB_KEY_h },
{ MODKEY, XKB_KEY_s, setmfact, {.f = +0.05f}, XKB_KEY_l },
```
Here, `MODKEY+i` triggers incnmaster to decrease nmaster, while `MODKEY+s` triggers a chain. After triggering the chain, pressing `h` or `l` changes the monitor's mfact and resets the chain.
### Download
- [chainkeys.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/chainkeys/chainkeys.patch) Latest version, applies to main branch, tested on commit dwl/dwl@e2038450f2
- [chainkeys_2024-05-20.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/chainkeys/chainkeys_2024-05-20.patch) Legacy version from 2024-05-20
### Authors
- [atourist](https://codeberg.org/atourist)
- [Ben Collerson](https://codeberg.org/bencc)