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