Score:3

GNOME minimizing/restoring all windows of a specific application

in flag

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).

Kurt avatar
in flag
I belatedly recognized there is a duplicate question, with better answers: [link](https://askubuntu.com/questions/1107496/how-to-quickly-minimize-all-windows-for-a-single-application?rq=1)
Score:0
in flag

I came up with rather a hacky, non-universal solution using wmctrl and xdotool. A custom keyboard shortcut registered with the command

/bin/bash -c "for wid in $(wmctrl -l -p | grep $(xdotool getactivewindow getwindowpid) | awk '{print $1}') ; do xdotool windowactivate $wid > /dev/null 2>&1 ; done"

activates 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 replacing windowactivate. 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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.