`setxkbmap` can be used to modify the keyboard layout under X11. For example, I use `setxkbmap -option ctrl:nocaps` to bind capslock to ctrl, to cut my pinky and wrist some slack.
Some people bind capslock to escape (e.g. `-option caps:escape`) because that's the keyboard layout under which vi was developed. I don't bother, because ^[ is equivalent to escape in a terminal, so I get more utility out of having ctrl:nocaps.
(See `man xkeyboard-config` if your system has it.)
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.