I want to know whether there is a way to use super(win) key alone as shortcut without change its function as a modifier.
On ubuntu, by default, pressing and then releasing super key, without pressing other keys, will invoke activity overview. But I want it to invoke a shell script written by me. And when super key and other key are pressed simultaneously, I want it to function as before.
I know how to disable super key from invoking activity overview in dconf-editor
, but I do not know how to remap it.
You can indeed put pressing and releasing Super to your own use with a utility like
xcape
(present in the default Ubuntu repositories) orksuperkey
.You first need to disable the default assignment of Super in Gnome Shell:
Then you can use
xcape
to redirect pressing and releasing Super alone to a regular shortcut key combination, in particular the regular keyboard combination you use to launch your script.For example, suppose we want Super to display the application overview. That action is already bound to Super+a, so to achieve that, we autostart the following command on login:
For your custom script, assign it a regular shortcut first using "Settings - Keyboard Shortcuts" and substitute
Super_L|a
by that shortcut key.To undo, disable the autostart command and reset the dconf key to default with the command
gsettings reset org.gnome.desktop.wm.keybindings panel-main-menu
.