I googled this topic and a lot of people suggesting
setxkbmap -option ctrl:nocaps
I put this line into my .bashrc
. However, frequently this key binding is disabled automatically. This happens randomly when I am doing other things. It is the most annoying when I am using vim, a lot of key mappings are affected. I need to open a terminal to re-run the previous command, which will get it work for another random period of time until it is deactivated again.
Does any one shared the same experience? How to have this mapping permanently?
I finally figured out that it is ibus that resets the key map every time I change input engine.
setxkbmap
is a lower level tool that does not communicate with the DEs, and the resets you see are the daemons changing back to whatever preferences they know about. see https://unix.stackexchange.com/a/66657/222377 for examples on setting and https://askubuntu.com/a/582498/669043 for an example on disabling the GNOME daemon. note thegsettings
commands in those answers may be outdated for modern GNOME. – quixotic Nov 07 '17 at 04:47