I have done quite a lot of research on how to swap the Escape and Caps Lock keys.
I achieved it while using X11 via my .xinitrc file and the following line of code:
setxkbdmap -option caps:swapescape
However, when I start a tty, it doesn't work. How can I get this to work while using a tty? Is it possible to use some kind of global option, like a custom keyboard layout that does not depend on X11?
I'm using Arch Linux, if that helps.
dumpkeys | head -1showskeymaps 0-2,4-6,8-10,12for my current keyboard layout (de-latin1), should I put that output or the suggested output ofkeymaps 0-127in the file? – Peter Arbeitsloser Oct 25 '20 at 10:58XKBOPTIONS="ctrl:nocaps"to/etc/default/keyboard(it works in Debian with both vts and xorg). Otherwise, you can do it by hand withdumpkeys | sed 's/keycode *58 =.*/keycode 58 = Control/' | loadkeys(you may have to adjust the sed expression, check withshowkeyanddumpkeys | lessbefore). – Oct 25 '20 at 12:56nocaps;-) but it may still give you the idea how to tackleswapescapetoo. – Oct 25 '20 at 12:59/etc/profileor/etc/profile.d/, and make it conditional on the type of terminal:[ "$TERM" = linux ] && dumpkeys | ... | loadkeys. – Oct 25 '20 at 15:29