I'm using Ubuntu 20.04.4 LTS with GNOME 3.36.8, and I just switched from Windows to the Linux multiverse. My laptop keyboard has the following keys to the left and to the right of the Spacebar:
Ctrl Win Alt Spacebar AltGr PrtSc Ctrl
and I'd like to achieve the following remapping:
AltGr Alt Ctrl Spacebar Ctrl Alt AltGr
while mapping Win to CapsLock. The reason is that I use Emacs a lot, and also type in languages with many diacritics.
More precisely:
- By AltGr I mean the modifier key that gives characters with diacritics in some keyboards, such as "à". Possibly it corresponds to the
mod5
modifier, but I'm not sure about this. - By Win I mean the key that often activates special functions at the windows-manager level, for example opening Activities, or moving windows to another workspace. I think it's associated with the Super key, but again I'm not sure.
Also: if possible I'd like to keep these remappings even if I change my keyboard layout, say from Dvorak to Qwerty. But if this is not possible, I'm happy modifying a layout.
To achieve these remappings I first tried the GNOME Tweaks tool, but it does not allow me to do all of them, only some. On top of that, I notice that the windows manager somehow interferes with the Win key, which in some cases still opens the Activities screen, even if theoretically it should have been remapped.
I was also trying to use xmodmap
, but some recent sites say that it's an obsolete way and I should use setxkbmap
instead (is that true?).
I checked several questions and answers on Stack Exchange, but most of them seem to be quite outdated. I'd appreciate some instructions or a reference to an understandable and updated tutorial. Thank you!