←back to thread

2039 points Gadiguibou | 5 comments | | HN request time: 1.066s | source
1. verst ◴[] No.36496711[source]
I like to hide all icons or folders on my Desktop when I need to be more productive or when I'm presenting. This can be done with:

  # hide desktop icons and folders
  defaults write com.apple.finder CreateDesktop 0
  killall Finder # restarting Finder is required

  # unhide desktop icons and folders
  defaults write com.apple.finder CreateDesktop 1
  killall Finder # restarting Finder is required


I made myself a convenient bash alias for this which lets me simply toggle the desktop on and off Here is a gist: https://gist.github.com/berndverst/6f58c0d6aedddb6c06c23e57d...

  toggledesktop () {
    if [[ $(defaults read com.apple.finder CreateDesktop) -eq "0" ]]
    then
        export SHOWDESKTOP=1;
        echo "Unhiding Desktop icons"
    else
        export SHOWDESKTOP=0;
        echo "Hiding Desktop icons"
    fi
    defaults write com.apple.finder CreateDesktop $SHOWDESKTOP
    killall Finder
  }
replies(2): >>36505146 #>>36512317 #
2. IggleSniggle ◴[] No.36505146[source]
I've used this one for over a decade now. When I was a teacher, I even assigned it to a key-combo. Consider pairing with a few other things you might want in a presentation setting
replies(1): >>36510389 #
3. verst ◴[] No.36510389[source]
What do you use for assigning it to a key combination? Can it be done without a third party tool?
replies(1): >>36517193 #
4. desro ◴[] No.36512317[source]
Turning off the desktop is one of the first things I do when setting up a new Mac. I still use ~/Desktop often enough that it's one of two folders I keep in the Dock (the other being ~/Downloads).

Although: the introduction of Stacks to the macOS desktop was a great thing — I always show that feature to anyone whose Desktop is helplessly cluttered with files.

5. niels_bom ◴[] No.36517193{3}[source]
Automator should be able to do that.