How to add a "Show desktop" icon to the launcher?

I recently upgraded from 10.04 to 12.04, and there is no show desktop in the launcher. I know I can use Ctrl+Super+D, but is there a way to get it in the launcher?

Edit:
I just installed the "show desktop" icon on the launcher with MyUnity (see below) and it worked fine. It did not install the icon above Dash launcher, but well below it. That bug has apparently been fixed. This is as of 2012.9.30.


13.04 and later

The show-desktop icon is now a toggle option via System Settings - Appearance

enter image description here


12.04 and earlier

You could install MyUnity Install MyUnity and there you will have the option to active "Show Desktop".

Note: As of May 2012, this places the Show Desktop icon above the Dash icon. This is a bug.

myunity app window


Only a workaround:

  1. Install xdotool
  2. Create a file ~/.local/share/applications/show-desktop.desktop
  3. Paste the following into that file:

    [Desktop Entry]
    Name=Show Desktop
    Exec=xdotool key --delay 300 super+d
    Icon=desktop
    Terminal=false
    Type=Application
    StartupNotify=true
    
  4. Make the file executable:

    Right click -> Properties -> Permissions -> Tick ‘Allow executing as a programme’

  5. Now browse to that file in Nautilus and drag it to the launcher:

enter image description here

The problem with this is, that you have to wait a bit after you started the launcher before you can start it again. So you can not quickly do hide -> unhide. It actually works via the command line, so maybe there's a way to fix this, but I have no idea how.

Update for 11.10:

In 11.10 the shortcut super+d doesn't seem to work anymore. Instead use ctrl+alt+d. However, the above mentioned problem remains.

Update for 12.04:

In 12.04 you will be able to enable a launcher item via ccsm (Ubuntu Unity Plugin options → Experimental tab):


(source: xrmb2.net)


Ubuntu 12.10

To add "Show desktop" icon in Ubuntu 12.10:

  1. Launch Dconf Editor (from dash or otherwise).
  2. Go to com > canonical > unity > launcher.
  3. In favorites, add 'unity://desktop-icon'.

dconf-ediotr

This icon can now be repositioned by dragging and dropping.

Source