Yes, you can use a keyboard shortcut for showing the desktop, but I wanted this in Gnome Do / Docky and managed to create an applet (actually a script) to use in Docky.
The main challenge was to find a way to show / hide the windows from within a terminal. Then I found wmctrl, a tool which can hide / restore your windows from the command line.
The following instructions are for Ubuntu / Gnome, but should work for other Linux distributions / desktop environments too.
sudo apt-get install wmctrl
2. Create an empty file and call it whatever you want. I have a Scripts folder in my Home directory where I keep all these scripts, so you can do the same. Let's say we call the script "show_desktop.sh". Paste the following code inside this file:
#!/bin/sh
if wmctrl -m | grep "mode: ON"; then
exec wmctrl -k off
else
exec wmctrl -k on
fi
And make it executable. To do this, open a terminal and:
chmod +x /path/to/show_desktop.sh
Replace /path/to with the path to where you created the script.
3. Now right click on your Gnome panel and select "Add to panel" and select a new "Custom application launcher". Choose whatever icon you want for it, name it "Show Desktop" (this name will be displayed when hovering the icon in Docky) and in the command field, enter the full path to the show_desktop.sh file you just created.
You can play with this new custom launcher to see if it's working.
4. We're basically done, all you have to do is drag and drop this launcher to Docky.