3

I'd like to be able to use the Windows/Super key on my keyboard as the Meta key. I'm doing this because the standard Gnome bindings are not all tweakable. You can change a lot of them but Gnome seems to insist on Super being the application launcher and to click/drag windows. This seems to interfere with some applications ability to use the Super key as a modifier for other keys/mouse clicks.

I'm thoroughly stumped by this. I've tried the following:

  • using gnome-tweaks to swap the alt/win keys. This gets me halfway there, but there's no combination of options that allow both settings to exist for some reason
  • using xkbcomp to remap the alt key to meta and the win key to alt. This seems to work in applications (I can clearly see the keycode swap working in xev), but Gnome refuses to honor this change for reasons that are wholly unclear to me. It continues to treat the Alt key as the Alt key and the Windows key as the Windows key.

Is this possible to do?

4 Answers4

3

You don't need to install additional software to do these changes. Simply set the dconf key "/org/gnome/desktop/input-sources/xkb-options" to contain altwin:swap_alt_win.

You can use gsettings, dconf or the gui (dconf-editor) to update the value.

gsettings set org.gnome.desktop.input-sources xkb-options "['altwin:swap_alt_win']"
1

My first thought was just re-mapping the key, for example if you use xev in terminal then press a key it tells you its keycode i.e. left windows is 133 and right windows key is 134. But I do not know what the keycode is for a meta key.

It seems most modern keyboard layouts do not support META and instead use AltGr on some international layouts, AltGr can also be simulated by Ctrl+Alt or rightALT depending on what documentation you read

You may be able to add a keyboard layout to your system that supports it and use the keyboard shortcut for the system to switch between layouts.

0

Try this - install an, input remapper (simple, yet powerful) there is right and left meta key to remap super left or right https://github.com/sezanzeb/input-remapper

https://raw.githubusercontent.com/sezanzeb/input-remapper/main/readme/screenshot.png

0

You can use the remapper deamon keyd for this purpose. See this answer for installation, usage and tips.

After installation, use the config below.

[ids]

[main]

leftmeta = layer(alt) leftalt = layer(meta)

Rasmus
  • 8,655