I am using Ubuntu 18.04 with GNOME. I would like to know if there is any functionality that allows to associate multiple windows in such a way that when one of the windows is minimized all the other are too and when the window is restored all the others too.
I.e. I am working with multiple terminal windows and I would like to group the terminals in N groups, in such a way that when I minimize a terminal window all other terminal windows that belong to that group get minimized too.
The following procedure is only for $XDG_SESSION_TYPE x11.
Notes:
Important:
To ensure that the terminal window's title does not change, I had to first comment out the following lines from ~/.bashrc. If this is not done, the title will reflect the current working directory instead of retaining the title you set:
I named each window using
Note that xdotool, as used here, won't handle windows named using
See the answer to Setting terminal window's title: wmctrl versus xdotool for a thorough explanation.
The following animated gif will illustrate using another "master" terminal, located at the top of the screen in the image, to issue code to minimize or maximize a particular group of windows.
To do so, I added the following functions to my ~/.bashrc:
mmm
uses xdotool to search for the string "KEYWORD" provided by the user. "earth" in this example, is common to one group of terminal windows to be acted on. xdotool produces their window identifiers which is directed to a temporary file.xwn
uses xdotool's windowminimize action to minimize the windows specified in the temporary file.xwx
uses xdotool's windowactivate action to maximize the windows specified in the temporary file.mmm
immediately beforexwn
orxwx
.I had to use
mogrify -type Grayscale -depth 7 *.png
to scale down the size of the gif.I'm not aware of anything that provides exactly what you're looking for, but you can try this kinda ugly workaround by following the steps below.
Ubuntu 19.04 I have not tested this script , feel free to correct me on those keystrokes. you could use a script to minimise the window and other windows by selecting them from a names list and sending the minimise keystroke to them. unfortunately I do not see minimise window shortcut in Gnome keyboard shortcuts. set a shortcut key in Gnome to run this script. keydown alt + space release then m (or enter as minimise is the first in my window min/max/move list) would do the trick though, xdotool keystrokes help here https://www.linux.org/threads/xdotool-keyboard.10528/