Minimizing all windows in Gnome

The Gnome desktop environment is missing a very convenient feature: Minimize all windows. The “Show desktop” command (Alt-Ctrl-D) does not toggle all windows to a minimized state. Instead, it gives focus to the desktop window. Than, if you press it again, it does not re-minimizes all the windows, in case you opened new ones. It un-focuses the desktop and raises all the minimized windws – Exactly the opposite of what you expect! I got really annoyed by this, since that I keep on my desktop work-in-progress files, and to get to them quickly I want to minimize all the windows, not toggle the desktop focus. But this is not a ranting post – A solution follows.

I’ve been looking for a solution to this annoyance for some time now. Gnome built-in commands does not help, and wmctrl is no good either. I was almost tempted to implement this command myself by using raw access to libwnck. At the last moment I was saved from hacking C code by this application: Devil’s Pie (see manuals here and here). This nice application runs in the background and applies rules to windows’ properties: E.g, always put Firefox on desktop 1, start Thunderbird minimized, make the chat window transparent, etc. In principle, using it to minimize all the windows will result in an awkward behavior: Every window will start minimized. However, one undocumented command in the Devil’s Pie’s rules is quit. It means, “run these rules and terminate” – Exactly what I need!

Devil’s Pie takes its rules in a Sexp format. The basic script to minimize all the windows is:

(begin
  (minimize)
  (quit))

To run it, save this expression in a file “minimize.ds” and use this command:

devilspie minimize.ds

Et voila! All windows rush down to the taskbar.

If you don’t want some window to be minimized – For example, the Tilda pop-up console – You can add a filter. This is my script:

(begin
  (if (not (is (application_name) "tilda"))
    (minimize))
 (quit))

Now all you have to do it to bind this command to some key shortcut: Follow, for example, this article.

Now pressing “Super-D” minimized all the windows on my desktop and gives me quick access to my work files. Joy!

Posted Thursday, March 26th, 2009 under Linux.

One comment so far

  1. Not that I’m impressed a lot, but this is a lot more than I expected when I stumpled upon a link on Furl telling that the info is quite decent. Thanks.

Leave a Reply

Security Code: