I am using this on my .bashrc
file:
## SWAP CONTROL KEY
setxkbmap -option ctrl:swapcaps
I did this, basically, because I am using Emacs a lot. It seems to work most of the time.
Unfortunately, 2 problems keep happening:
(i) - After the PC starts, it takes a while to work. It is not instantaneous which intrigues me, since this seems to be something "small" to change;
(ii) - Sometimes, out of the blue, it has stopped working, and then, suddenly, the swap is back. This happened one time today.
Although it was just one time, it is really annoying because I have changed the keybinding recently. So, I am already making mistakes sometimes while getting used to it. If I cannot trust this keybinding, the mistakes are going to be even more frequent.
I have a huge knowledge gap on .bashrc
file configurations. Maybe, there is some inconsistency in my file. Here is a repository on GitHub showing the whole .bashrc file.
Thanks.
.bashrc
is only referenced with the terminal opening into a login shell. Unless you're logging directly into a terminal login shell (Bash) it won't load at start. It also may not be persistent. GUI environments though don't refer to.bashrc
when you load up on boot.setxkbmap
definition? I would like to have it as a persistent change and loading up on boot./etc/rc.local
but that's more or less deprecated nowadays in favor of SystemD oneshot units at boot time. Which would work for literally the entire system (or they should anyways). Let me write up an example in an answer. If it works, great, if not, we'll keep chugging along on potential solutions.