assign super_l to custom keyboard shortcut in gnome linux

1k Views Asked by At

I want to assign the super_l key on the keyboard to a custom keyboard shortcut.

I already know how to assign this key to a default keyboard shortcut like, lets say the "run_terminal_command" shortcut, by editing the keybinding manually in the gconf-editor or by assigning it directly via

gconftool-2 --set /apps/metacity/global_keybindings/run_command_terminal --type string "Super_L".

If I create a custom shortcut that executes any command, I can to that via the "Keyboard Shortcuts" menu under Linux Red Hat. In this settings window, I can not assign the Super_L key, because it is only identified as a modifier-key just like CTRL. I press Super_L+T and I get a "Mod4+T" entry in the List and the command is executed. So far so good.

Now I want to assign only the Super_L key to that custom shortcut. If I do it in gconf-editor or via

gconftool-2 -s /desktop/gnome/keybindings/custom0/binding --type string "Super_L".

and I hit the left windows key, nothing happens.

So do any of you know I way to get this to work?

I already found a workaround by looking into the gconf-editor where there are 12 default "run_command_X" (X=[1-12]) and corresponding command_X keys to set the command. They behave like the run_terminal_command I mentioned above, so I can assign the Super_L to that.

Anyway, these entries do not show up in the "Keyboard Shortcuts" menu, so I'm still curious how I can assign the Super_L key to a costum shortcut

Thanks!

1

There are 1 best solutions below

0
On

There is no easy way to bind a modifier key (Super, Ctrl, Alt, Shift) to a custom command, I think this is intentional (because it causes problems when other key bindings include the remapped modifier).

From what I read the only way you can do it is by changing super to be a normal key (for example with xmodmap), however you will no longer be able to use it as a modifier and it may break other shortcuts.