Skip to main content

Show desktop (or minimize all) in KDE 4

Disclaimer: Please correct me if you know better. Thank you. Back in KDE 3 I've been using WIN+D repeatedly to minimize all open windows ("show desktop"). In KDE 4 the "show desktop" feature seems to have been replaced by "show dashboard" (CTRL+F12), which is quite a different thing and not what I want. As missing the minimize-all hotkey started really bugging me I invested a little time to find out if this is really the end. Luckily it's not though I can only present a workaround rather than a "real solution". The easiest (only?) way to assign global hotkeys to programs in KDE 4 is adding an item to the KDE menu. So if we had a program/command to trigger a toggle on "show desktop" we were done. I found a tiny Bash script to do that:

#!/bin/sh
target=on
if xprop -root  _NET_SHOWING_DESKTOP | fgrep '= 1' ; then
    target=off
fi
wmctrl -k ${target}

(requires xprop and wmctrl, i.e. x11-apps/xprop and x11-misc/wmctrl in Gentoo) Put that in a file called toggle-show-desktop.sh or so, make it executable and add a KDE menu entry for it: (The Menu Editor can be found in the contect menue of the "KDE button" also know as Application Launcher Menu.)

Now assign a hotkey in the "Advanced" tab, done.
For comparison/completeness in KDE 3 it's here:

.. and in XFCE here:

My next post/rant on KDE4 will probably be about the removal of vertical gradiants as desktop backgrounds. No, I don't wat to do that with Gimp. Seems like I'm the only one ever having used it. Anyway...