gnome: minimize all other windows

A quick solution for minimizing all windows but the one that is currently in foreground. Tested with GNOME Shell 44.9, Fedora 38.

Install xdotool:

sudo dnf install xdotool

Create executable shell script:

currentwindowid=$(xdotool getactivewindow)
currentdesktopid=$(xdotool get_desktop)

for w in $(xdotool search --all --maxdepth 3 --desktop $currentdesktopid --name ".*"); do
  if [ $w -ne $currentwindowid ] ; then
    xdotool windowminimize "$w"

Create custom shortcut, example:

Kudos to:

Leave a Reply

Your email address will not be published. Required fields are marked *

Human? Please fill this out: * Time limit is exhausted. Please reload CAPTCHA.