I can disable Caps Lock in the GUI using following command:
setxkbmap -option ctrl:nocaps
But how can I disable it completely in the console, on a machine without X/GUI ?
I can disable Caps Lock in the GUI using following command:
setxkbmap -option ctrl:nocaps
But how can I disable it completely in the console, on a machine without X/GUI ?
dumpkeys | sed s/Caps_Lock/Control/ | loadkeys
On Debian and alike, just putting XKBOPTIONS="ctrl:nocaps" in /etc/default/keyboard works for both the console and X11 -- provided that you have the console-setup package installed. Use the setupcon command to immediately re-load that file.
Have been struggling to find information on line about this. I went with creating a "custom keymap", as suggested by the Arch Wiki. My commands were something like:
zcat /usr/share/kbd/keymaps/i386/qwerty/uk.map.gz > ~/personal.map
vim ~/personal.map
sudo cp ~/personal.map /usr/share/kbd/keymaps/
I used i386/qwerty/uk.map as a base because it was what I mostly wanted. It includes other maps meaning the file is much smaller than you'd get from dumpkeys. I only wanted to override a couple of modifier keys so this worked well for me.
You can verify it's getting recognized by running:
localectl list-keymaps | grep personal
and then set it as default by running:
sudo localectl set-keymap personal