Show Desktop icon in dock? Any way to do it?

Discussion in 'OS X Mavericks (10.9)' started by sentientbear, Jan 9, 2014.

  1. sentientbear macrumors newbie

    Joined:
    Jan 9, 2014
    #1
    Hi all,

    I want a show desktop icon in the dock (yes, as in Windows XP and 7). I can't figure out how to do this, including with scripting. Any help would be much appreciated!!

    Nota bene: I do NOT want to use keyboard or trackpad gestures.
     
  2. fisherking macrumors 601

    fisherking

    Joined:
    Jul 16, 2010
    Location:
    ny somewhere
    #2
    use the Finder icon that's always in your dock. and, under Finder preferences, set a new window to open with "Desktop"...

    EDIT: or, sorry...just open your Home folder, drag the Desktop folder to the right side of your dock!!
     
  3. ufkdo macrumors 6502

    Joined:
    Oct 30, 2010
    Location:
    Turkey
    #3
    Why don't you use 4 finger spread to show desktop? It is much easier in my opinion.
     
  4. HenryDJP macrumors 603

    Joined:
    Nov 25, 2012
    Location:
    United States
    #4
    I may be wrong but that doesn't quite sound like what the OP is trying to do. All that does is access the files on the desktop. Sounds like he is looking for a way to "show desktop", meaning like take all the windows off the desktop...as does the taskbar icon performs in...."cough cough" Windows.:cool:
     
  5. Bruno09 macrumors 68020

    Joined:
    Aug 24, 2013
    Location:
    Far from here
    #5
    You could use a "hot corner".

    See in System Preferences / Mission Control.
     
  6. w0lf, Jan 9, 2014
    Last edited: Jan 9, 2014

    w0lf macrumors 65816

    w0lf

    Joined:
    Feb 16, 2013
    Location:
    USA
    #6
    That doesn't actually show the desktop though.

    I dunno maybe they use a button mouse.

    ... Did any of you even read the OP?


    To actually answer the question...

    1. Open Automator
    2. Make a new Application (command + n)
    3. Add the action 'Run Shell Script' to the flow
    4. Delete the default text 'cat'
    5. Paste in this code
      Code:
      open /Applications/Mission\ Control.app --args 1
    6. Save the Application as Desktop
      • Make sure the File Format is Application and not Workflow when saving
      • Also it's probably best to save it in /Applications
    7. Navigate to wherever you saved the Application in Finder
    8. Drag the Application to your dock

    Congrats you just made your first Automator item! Now just click the icon in your dock to show the desktop.

    Here's a link to a nice icon for the app since the default automator icon doesn't really make me think 'show desktop'. http://www.artofadambetts.com/weblog/2006/09/updated-desktop-icon/

    Note for others who may be interested:

    Mission Control -- open /Applications/Mission\ Control.app
    Show Desktop -- open /Applications/Mission\ Control.app --args 1
    Application Windows -- open /Applications/Mission\ Control.app --args 2
    Dashboard -- open /Applications/Dashboard.app

    Alternate open command

    open -a "Mission Control"
    open -a Dashboard
     
  7. Bruno09 macrumors 68020

    Joined:
    Aug 24, 2013
    Location:
    Far from here
    #7
    I don't like your comment.

    I DID read the OP, for your information.

    I have the right to suggest another solution to see the Desktop without using the keyboard or a trackpad gesture.

    And, in MY opinion, a hot corner is a good (and OS native) solution.
     
  8. Trouble1 macrumors member

    Joined:
    Nov 18, 2007
    Location:
    Thailand
  9. sentientbear thread starter macrumors newbie

    Joined:
    Jan 9, 2014
    #9
    WHOOAAA... you actually answered my question! THANK YOU!

    It's like you actually read what I wrote and knew what you were talking about!


    Got time for a follow-up question? (If not, that's fine!) Do you know if there's a way to restore the application windows to their previous state by clicking the dock icon again? (Basically, exactly replicating the Windows show desktop function.) I'm totally not familiar with Automator, but this seems like something that might be simple enough, e.g., "on click 1 {X}, on click 2 {Y}." Using "Application Windows -- open /Applications/Mission\ Control.app --args 2" in Automator provides that function (but with an error msg...!), though it requires a separate dock icon.




     
  10. w0lf, Jan 10, 2014
    Last edited: Jan 10, 2014

    w0lf macrumors 65816

    w0lf

    Joined:
    Feb 16, 2013
    Location:
    USA
    #10
    Edit1:

    Clicking anything (other than the desktop app which would relaunch show desktop) in the dock while in "Show Desktop" will exit that view

    Edit2:

    You can:

    • Put the mission control app in the dock
    • Right click the icon
    • click show desktop
    • click the icon again to exit

    Edit3:

    The alternate Automator App (which is just a toggle you click) would be:

    Code:
    myval=$(defaults read ~/.desktop.plist "on_desktop")
    if ($myval); then	
    	defaults write ~/.desktop.plist "on_desktop" 'false'
    else
    	open -a "Mission Control" --args 1
    	defaults write ~/.desktop.plist "on_desktop" 'true'
    fi
    
    Note that this will only work properly in the dock because clicking any item in the dock while in "Show Desktop" automatically exits that view.

    ---

    I do not know a way to exactly replicate the windows button because I don't know of any way to check if you're currently "viewing the desktop" or not which would be required to be able to get the Application to work 100% perfectly.

    When you click the App in the dock it runs the application (which then quits almost instantly). I am unaware of a way to monitor mouse clicks. Like that.

    The part "Application Windows -- " was a descriptor you're only supposed to use the part after the double dash "open /Applications/Mission\ Control.app --args 2". Also Application windows is not what you'd want. Just clicking anything in the dock will exit the desktop view.
     
  11. sentientbear thread starter macrumors newbie

    Joined:
    Jan 9, 2014
    #11
    Awesome! Thanks!


     
  12. hallux macrumors 68020

    hallux

    Joined:
    Apr 25, 2012
    #12
    And, I believe, SO much simpler than writing an Automator script. By the way, using the hot corner replicates a gesture on the trackpad, spread with thumb and 3 fingers (opposite reverses). Some people over-think things.
     
  13. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #13
    I just tried it - it was very helpful. It took me all of about 60 seconds to follow the steps. :rolleyes:
     
  14. computersWTF macrumors newbie

    Joined:
    Jun 8, 2012
    #14
    Workaround to return open windows after 'Showing desktop"

    Thank you sentientbear and w0lf - this is extremely helpful.

    Also, FYI, once you click the automator/script icon to 'show desktop', you can return your open windows by clicking in grey space in your Dock bar (careful not to click on an actual icon). I generally click on the separator between the Trash icon and my other Applications to do so.

    ----------

    Thank you sentientbear and w0lf - this is extremely helpful.

    Also, FYI, once you click the automator/script icon to 'show desktop', you can return your open windows by clicking in grey space in your Dock bar (careful not to click on an actual icon). I generally click on the separator between the Trash icon and my other Applications to do so.
     
  15. sharon22 macrumors regular

    Joined:
    Oct 19, 2014
    #15
    Oooh! I LOVE this thread! I have been wanting a "show desktop" trick for YEARS! I was happy to learn that Command-F3 trick (I'm not on an Apple Keyboard right now, so I "think" it is Command-F3), but now, reading this thread, I'm excited to get back on my iMac and try this out.

    If it really works (sounds like it does), we should all throw a Party for the poster "w0lf" for such a cool suggestions!!

    (I'll bring the Pumpkin Cupcakes with Sprinkles!) :D
     
  16. Traverse macrumors 603

    Traverse

    Joined:
    Mar 11, 2013
    Location:
    Here
    #16
    Such sarcasm in this thread. :rolleyes:

    I think hot corners or a gesture would be easier, but the OP wanted an icon/script solution. Whatever works for them.

    I use a script to copy all the files and folders into another folder on my desktop for USB flash drive backup, I could just drag with the alt key, but I prefer a right-click script. Variety is the spice of life.
     

Share This Page