create one shortcut for maximize and restore window

I know that super+Up maximize the window and super+down restore it.

Is there any way from which I can do both with one shortcut? I mean pressing super+up will maximize but then again pressing it will restore the window.

Asked By: Parag Katoch


The shortcut is already there for you to use: it is Alt+F10.

If you want to also have Super+Up behave this way, then change the configuration. You can do so with following commands:

gsettings set org.gnome.desktop.wm.keybindings maximize "['']"
gsettings set org.gnome.desktop.wm.keybindings unmaximize "['<Alt>F5']"
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Alt>F10','<Super>Up']"

The first command clears the default assignment to Super+Up, the second removes the assignment of Super+Down and the third command adds Super+Up to toggle the maximized state, in addition to the default Alt+F10.

To undo, in each command change set to reset and remove the last part "[...]".

Answered By: vanadium