1

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?

  • You can disable Super launching the overview, and Supter for dragging windows. However, you asked something different here. We call this an XY problem. Asking about problem Y, which you think will solve your real problem X instead of directly asking about problem X. – vanadium Nov 09 '22 at 07:03
  • How do I disable those things? I can't find anything in the Gnome settings that disables either functionality, but this is a pretty arcane part of the desktop. I also do not know that that the super key will be well-behaved after I do those things at this point, but I'd be happy to try. – monitorjbl Nov 09 '22 at 15:45
  • Feel free to open a question about this. – vanadium Nov 20 '22 at 12:15
  • I did here: https://askubuntu.com/questions/1441271/how-do-you-disable-all-super-key-shortcuts-in-gnome?noredirect=1#comment2515266_1441271. I honestly don't think it's going to be sufficient for what I want to do, but I'm happy to try it if you know how to do it. – monitorjbl Nov 20 '22 at 21:11
  • not sure if it works in Ubuntu 22.04. as it use Wayland, but in 20.04 with Xorg, you can modify /usr/share/X11/xkb/symbols/ . – Mlocik97 Nov 24 '22 at 19:51

4 Answers4

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,375
0

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']"