Make Caps Lock an additional Ctrl

29 Jan 2022

This is the quickest and easiest way to make your Caps Lock key a Ctrl key instead. It works for X windows in Ubuntu 20.04. This solution is so simple that I don't care that it is X-windows-only; when Wayland becomes the default, I can worry about it then.

$ su -

# cat /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"

# sed -i -e 's/XKBOPTIONS=""/XKBOPTIONS="ctrl:nocaps"/' /etc/default/keyboard

# cat /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="ctrl:nocaps"
BACKSPACE="guess"

Then just log out of X and log back in to X.