keyd primer
I recently installed Fedora Asahi Remix on my Macbook Air M1 and wanted to swap my alt and command keys, plus rebind my caps-lock key as control. I’m still new to wayland (with plasma6 in this case) so I googled what tools to use and found rvaiya/keyd.
Installation was easy, quoting the project README:
git clone https://github.com/rvaiya/keyd
cd keyd
make && sudo make install
sudo systemctl enable --now keyd
Below is a configuration that Works For Me™:
# /etc/keyd/default.conf
[ids]
*
[main]
capslock = overload(control, capslock)
meta = layer(alt)
leftalt = layer(meta)
We swap alt/command, and we make caps-lock behave like normal when tapped, but when held it acts like a control key.
I’ve seen another configuration which makes caps-lock act like escape when tapped and control otherwise, plus remapping caps-lock to the normal escape key – but I’m not a vim user so not as useful for me.
That setup would look something like this:
[ids]
*
[main]
capslock = overload(control, escape)
escape = capslock
meta = layer(alt)
leftalt = layer(meta)