I have this right now in my ~/.Xmodmap

clear Lock
keycode 66 = Hyper_L

and xmodmap ~/.Xmodmap in ~/.bashrc.

This works alright for the first time but randomly the Caps Lock key goes back to working as a Caps Lock and I have to run the xmodmap command(generally by opening a terminal there by running ~/.bashrc) to map it back to windows key.

I am on Ubuntu 14.04 and using i3 window manager.

Is there a more robust way to do the mapping?

  • Don't call xmodmap from .bashrc: that triggers when you open a terminal, not when you log in. Put it in .profile, or use the GUI settings. – Gilles 'SO- stop being evil' Nov 13 '16 at 22:40

Keyboard layout options

You can go into system settings -> Keyboard -> Layout -> Options and configure it there. It does not require writing any scripts or running any programs at login. Just configure once and enjoy.

PS: This have been tried on Linux Mint 15 Cinnamon, Linux Mint 16 Cinnamon, Linux Mint 16 XFCE, Fedora 24 GNOME and Manjaro KDE. I'm sure Ubuntu 14.04 would also have similar option to configure.

  • I couldn't find a similar way to configure using system settings from unity-control-center. The keyboard settings don't this kind of configuration options. – ma08 Nov 13 '16 at 13:47
  • @ma08 I think you need to use the Gnome control center. The Unity control center is even more of a joke. – Gilles 'SO- stop being evil' Nov 13 '16 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.