Ubuntu – How to bind the super/mod/windows key to a custom command

keyboardshortcut-keys

I tried to add it in the default shortcuts application but it just won't accept super on it's own. It will accept Super + X But I just want to override the super key.

I'm using Mate so no Unity conflict.

I tried searching and did found a few very specific work around but none with the super key and a custom command/script.

Example what I want is:

Press Super
Do bash ~/rearange_windows.sh --all

Best Answer

You can use xbindkeys

Put your command with a "release" event into ~/xbindkeysrc.

For more info, see man xbindkeys.