Ubuntu: How to add a “Show desktop” icon to the launcher?



Question:

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.


Solution:1

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


Solution:2

13.04 and later

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

enter image description here


Solution:3

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):


Solution:4

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


Solution:5

You can also use compizconfig-settings-manager (ccsm) (instead of MyUnity) to adjust this setting.

Open CCSM, and click on Ubuntu Unity Plugin settings, then select the Experimental tab and check the box beside Show "Desktop Icon" in the launcher.

enter image description here

This will place the icon at the top of your dash, so you'll need to do as @Roland Taylor suggested and reset unity (unity --reset).


Additionally, you can show desktop using the Alt-Tab switcher

enter image description here


Solution:6

You can quickly show the desktop using the keyboard shortcut Ctrl + Super + D. I do not know of an option to use an icon.


Solution:7

When you are using Unity you got animations activated and could then use an edge binding. Whit this you even don't have to click.

You can install CompizConfig Settings Manager from the Software Center go to 'General Settings' (1.) then to key bingings (2.) and there you can choose an edge to trigger 'Show Desktop' (3.). There you also have the option to set an individual keyboard shortcut.

show desktop with edge binding


Solution:8

There is a "Show desktop" icon when alt-tabbing, so you can use alt-tab then shift-alt-tab to accomplish this.


Solution:9

Ubuntu 11.04


From webup8.org: (With slight modifications by me)

  1. Install wmctrlInstall wmctrl.

  2. Download the script and .desktop file, extract it and place the "showdesktop" script in the /usr/local/bin folder using the commands below:

    cd ~  wget http://webupd8.googlecode.com/files/showdesktop.tar.gz  tar -xvf showdesktop.tar.gz && rm showdesktop.tar.gz  sudo mv showdesktop /usr/local/bin/  

    If you want to manually download the file, get it from HERE.

  3. Now you should see a file called "showdesktop.desktop" in your home folder - you can move it wherever you want (or leave it there) and then simply drag it to the Unity launcher and you'll have a "Show desktop" icon.

Known issue: when clicking the "Show Desktop" icon in the Unity launcher, you'll have to wait until the icon stops pulsating before clicking it again (that's about 10 seconds) or else the it doesn't do anything. You can middle click when the icon is pulsating if you don't want to wait (thanks to Mahdi for the tip!).


Solution:10

Reset Unity (unity --reset), and then reenable it, to put it back in the right place.
enter image description here


Solution:11

For 12.10

Unity patch team at work!

We have created a script that lets you enable/disable show-desktop icon. If you dont want to install a separate tool, grab our script and run it.

It is hosted on bitbucket at https://bitbucket.org/jpmahesh/unity-reset

Or if you are lazy and prefer not to open another page, here's the snippet.

#!/usr/bin/python    from gi.repository import Gio  import argparse    parser = argparse.ArgumentParser(description='Enable or disable show-desktop icon')  optiongroup=parser.add_mutually_exclusive_group(required=True)  optiongroup.add_argument('-e','--enable',action='store_true',help='Add show-desktop icon to launcher')  optiongroup.add_argument('-d','--disable',action='store_true',help='Remove show-desktop icon from launcher')  args=parser.parse_args()    gsettings=Gio.Settings("com.canonical.Unity.Launcher")  launcherfav=gsettings.get_strv('favorites')  shwdsktp="unity://desktop-icon"  def remove_show_desktop():    if shwdsktp in launcherfav:      print "Show desktop is currently enabled."      print "Removing show desktop"      launcherfav.remove(shwdsktp)      gsettings.set_strv('favorites',launcherfav)      print "DONE"    else:      print "Looks like the show desktop icon is already hidden"      print "Nothing to do then. Tada!"    def add_show_desktop():      if shwdsktp not in launcherfav:          print "Show desktop icon is currently hidden"          print "Adding it to launcher"          launcherfav.append(shwdsktp)          gsettings.set_strv('favorites',launcherfav)          print "DONE"      else:          print "Looks like the show-desktop icon is already visible"          print "Nothing to do then. Tada!"    if args.enable :      add_show_desktop()  if args.disable :      remove_show_desktop()  

Usage:

Save the above code in a file called show-desktop.py and in a terminal, run:
python show-desktop.py -e to show the icon
python show-desktop.py -d to hide it.
python show-desktop.py -h to see the usage message.

By default(without any arguments), it just prints the usage message and exits.


Solution:12

Based on graphical procedure already described here.

We can copy and paste the following command to do this for us:

Add show desktop if not already present

key=/com/canonical/unity/launcher/favorites; new="'unity://desktop-icon'"; dconf read $key | grep -q "$new" || dconf write $key "$(dconf read $key | sed "s%^\[%[$new, %")"  

Similarly we could remove it again:

Remove show desktop if present

key=/com/canonical/unity/launcher/favorites; new="'unity://desktop-icon'"; dconf read $key | grep -q "$new" && dconf write $key "$(dconf read $key | sed "s%$new, %%")"  


Solution:13

I found that this link here did the trick. Though it's more of an application than a feature.

Hope it helps!


Solution:14

You can also use ubuntu-tweak (instead of MyUnity/compizconfig) to adjust the setting.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »