I use the following command to remap the Caps Lock key to Esc:setxkbmap -option caps:escapeUnfortunately, I have to type the command every time I create a new session. I tried putting it in my .bashrc but it did not work. I guess the keyboard settings must be getting overwritten somehow after the .bashrc has run.How can make the key binding automatically occur?
Remapping Caps Lock for every session
ubuntu;x11;login;keyboard layout