In GNOME desktop, how can I minimize/restore all windows of a specific application?
I know the shortcut Super + d hides all normal windows and then restores them, but I'm looking for its equivalent that works only for windows of a given application (for example, the application running in the current window).
I came up with rather a hacky, non-universal solution using
wmctrl
andxdotool
. A custom keyboard shortcut registered with the commandactivates specific windows that have the same PID as the current one's, and works as desired with applications like GNOME Terminal, Nautilus, Firefox, and others. The minimization shortcut can be added with the
windowminimize
option replacingwindowactivate
. I tested the shortcuts in Ubuntu 18.04 with GNOME version 3.28.4.Since the command discriminates windows by their PIDs, this solution does not work when windows of the same application have different PIDs.