Ubuntu – How to remap CapsLock to Ctrl in Xubuntu 12.04

12.04keyboardxubuntu

I tried doing it like follows (in autostart):

setxkbmap -option "ctrl:nocaps"

and it works, but only for a while – then the setting is reset back to original state. How can I make it persistent?

I use xfce4-xkb-plugin as my input language switcher, but it doesn't seem to have an option to set caps key function.

Best Answer

Add the setxkbmap option in XKBOPTIONS in /etc/default/keyboard. That file is also when you run sudo dpkg-reconfigure keyboard-configuration, however running that command does not interactively let you choose to swap Caps Lock and Ctrl, so you will need to edit the file by hand.

Related Question