0

I'm looking to replace Caps Lock behaviour with the "Left Alt"/"Meta" modifier, in GNOME / X11.

There are a few options to replace Caps Lock with Super, Ctrl, etc. in GNOME Tweak Tool, which seems to use xkb via dconf internally, but there is no option to make Caps Lock behave as Meta there. Looking at less /usr/share/X11/xkb/rules/evdev confirms that this is not due to Gnome Tweak Tool, but an artifact of such a (named) rule just missing generally in X11.

Simply remapping via xmodmap -e 'keycode 66 = Alt_L' seems to work at first and actually sends Alt_L as confirmed by xev, and the Caps Lock LED doesn't change anymore, but no Alt/Meta behaviour happens when I press the key. For instance, CapsLock+B does not go a word back in the terminal as Alt+B does.

How do I do this?

0

After looking at https://unix.stackexchange.com/a/195160/222974, I found out that adding clear Lock to the xmodmap command makes it work. I then put these two commands in a (new) file at ~/.Xmodmap:

keycode 66 = Alt_L
clear Lock

and set xmodmap ~/.Xmodmap to run during GNOME session startup using https://github.com/hant0508/startup-settings.

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.