Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
1  
As of 14.04, this is possible natively as per fossfreedom's answer. (Should that be the accepted answer?) MyUnity will not work from Quantal onwards, and the Experimental tab of the Unity plugin in CCSM does not exist in 14.04. –  ΕΠΑ May 12 at 17:34

14 Answers 14

up vote 24 down vote accepted

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

share|improve this answer
1  
MyUnity isn't in the 12.10 software Centre anymore. Where can I get it? –  Dominic Jordan Hasford Oct 22 '12 at 3:14
    
MyUnity isn't supported on 12.10 yet. askubuntu.com/q/203709/34385 –  Jeggy Oct 22 '12 at 13:45

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

share|improve this answer
    
wow, you are good! but why didn't they just build it this way? did they "forget" the show desktop-icon? it maskes working faster + easier. –  melodram Mar 11 '11 at 22:03
    
@melodram I'm not sure how it can be easier than a keyboard shortcut but that might be just me. –  Octavian Damiean Mar 12 '11 at 13:39
    
1 quicker way would be to use the command sequence super+d uses. I have seen those somewhere on askubuntu. I think is was called (minimize). Found it: askubuntu.com/questions/13709/… Would that be faster? –  Rinzwind May 5 '11 at 13:34
    
@melodram: You should probably "accept" this answer by clicking on the tick mark. Cheers! –  Nicolas Raoul Jun 14 '11 at 2:12
1  
xdtools is not in the apt-get :( –  Tom Brito Dec 3 '11 at 0:12

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

share|improve this answer
2  
I couldn't find this info anywhere else, thank you! :) –  askuhn Oct 20 '12 at 2:24

13.04 and later

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

enter image description here

share|improve this answer
3  
This is the way to do it! –  Konstigt Aug 15 '13 at 11:07
    
thanks buddy !! –  Hari Gudigundla Aug 15 at 9:39

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

share|improve this answer
    
This option is not available in 12.10 –  HDave Oct 25 '12 at 15:06

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

share|improve this answer
1  
i hope they will create in icon for that, like in the gnome-panel. would make work easier and faster. –  melodram Mar 11 '11 at 20:55
1  
Or at least discoverable... Unity devs seem to think we're mind readers sometimes. –  Scaine Mar 23 '11 at 21:47
    
And I'd just like to add - just installed 'Natty', and I switched immediately to the 'Classic Destop' - but even here, Ctrl-Alt-D does not work anymore -- one must use Super+D! Thanks for the tip, cheers! –  sdaau Mar 25 '11 at 20:54
    
I am in complete love with all ubuntu news and bla bla but if I could slap the guy that decided to change the classical windows + d to show desktop to control-ald-d and then CHANGE IT BACK I'd feel really better. –  Pitto May 22 '11 at 18:12
    
The question already clearly says that the user knows about Ctrl-Super-D, but is looking for a launcher icon shortcut. So it's useless to just reply "I don't know". –  mivk May 29 '13 at 15:02

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

share|improve this answer
    
This works as a workaround in some cases but for people wanting an easy point and click way to do this, it still doesn't solve the problem –  Kristofer Oct 17 '11 at 20:32
    
Nice alternative! –  T.J. Crowder Oct 19 '11 at 9:58
    
Great! You could also add an screenshot to illustrate. –  Tom Brito Dec 4 '11 at 23:18
    
Done, hope it's even more helpful now. –  joschi Dec 6 '11 at 8:09

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

share|improve this answer
    
Note that this is for Ubuntu 11.10. You can also use the arrow keys to Navigate to the Show Desktop icon, if you prefer. –  Christopher Kyle Horton Oct 19 '11 at 0:03

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

share|improve this answer
1  
Despite toggling the setting for show desktop in ccsm and running unity --reset as suggested, I can't move the button anywhere on the launcher. Thankfully the bug report shows that a fix should be on the way :) –  askuhn Apr 28 '12 at 4:45
    
@askuhn I never said you could move it "anywhere on the launcher". –  RolandiXor Apr 28 '12 at 14:59
    
Sorry, to clarify, when I said "anywhere" I also meant below the workspace icon as in your screenshot...I can't even get it down there ("unity --reset" just makes it disappear altogether for me). –  askuhn Apr 28 '12 at 15:47
    
@askuhn oh I forgot to mention, after running unity --reset you have to enable it again. –  RolandiXor Apr 28 '12 at 18:44
    
I did try that with no luck...the icon still placed itself above the BFB. I'm fine waiting for the update though, thanks for your help! –  askuhn Apr 28 '12 at 22:38

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!).

share|improve this answer
    
Thanks, I prefer this to the answers in the other question this was closed as a duplicate of, since I already use wmctrl for other things. (Perhaps worth posting there in case this one gets deleted.) –  T.J. Crowder Oct 19 '11 at 9:59
    
This is the only that worked for me. Thanks! –  HDave Nov 9 '11 at 0:47

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.

share|improve this answer
    
What do you mean save a file? Could you explain the usage a little more clearly? –  Dominic Jordan Hasford Oct 22 '12 at 4:16
    
open a text editor, copy the code, and save it as show-desktop.py Can you drop by in chat if you face any difficulties? –  Mahesh Oct 22 '12 at 5:41
    
IMHO this would be the best way, so you don't have to install dconf. However on my 12.10 it doesn't work: it prints "DONE", but doesn't really set anything (I tested with a gsettings get and the value was the same array it was before) –  Raffaele Nov 2 '12 at 14:22
    
This script uses the python interface to gsettings. If gsettings set works, then this should work. I suggest you try that and join the chat if you notice anomalies. –  Mahesh Nov 2 '12 at 17:34

Based on graphical procedure already described here: http://www.ubuntuvibes.com/2012/10/things-to-do-after-installing-ubuntu.html

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, %%")"

share|improve this answer

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

Hope it helps!

share|improve this answer
    
Of course it won't help. This question is about 12.04 and you are referring to a question about 11.10. –  jokerdino Jun 19 '12 at 11:53

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.