💾 Archived View for kota.nz › notes › disable_capslock captured on 2022-03-01 at 15:19:27. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
2021/06/27
Capslock is a useless key so I figured I'd reassign it to something useful. There are three ways to change a keys function.
If you're using a non-Xorg machine the first option is probably what you'll want to pick, but in the case of a Xorg machine option 3 is much simpler and better. I'm not actually sure the best way to do this on Wayland, but I guess I'll have to figure that out eventually since Wayland is getting better and better.
since Wayland is getting better and better
You can set xkb settings either with the command line tool setxkbmap which could be placed in your .Xinitrc for user settings or you can set them system wide in your Xorg config. Most modern distros split the Xorg config into various config files under /etc/X11/xorg.conf.d/.
To disable the use of the caps lock key you can simply create a file in /etc/X11/xorg.conf.d/ named 90-disable-caps.conf (or similar). Then place the below contents into that file. The files in that directory are loaded based on their sort order, so traditionally the names begin with two numbers that determine the load order.
Section "InputClass" Identifier "keyboard defaults" MatchIsKeyboard "on" Option "XKbOptions" "caps:none" EndSection
Basically this matches "keyboards" and sets the option caps:none. A full list of possible options is located inside /usr/share/X11/xkb/rules/base.lst. Most of the time you'll want to swap caps for control or similar instead of outright disabling it. ctrl:nocaps Would switch it to control.
--------------------------------------------------------------------------------
I added a link showing some of wayland's improvements.