Skip to content

Instantly share code, notes, and snippets.

@emotality
Created July 7, 2015 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emotality/6e89c6cffe4eb0fae43f to your computer and use it in GitHub Desktop.
Save emotality/6e89c6cffe4eb0fae43f to your computer and use it in GitHub Desktop.
Hide or show desktop items in OSX.
#!/bin/bash
#### Created by Jean-Pierre Fourie
### https://github.com/emotality
## hide_desktop.sh
#
clear
echo " "
echo " ######################################################## "
echo " ################## HIDE DESKTOP FILES ################## "
echo " ######################################################## "
echo " "
echo " ** Note: This will just hide desktop files, not delete them. **"
echo " "
read -p " Hide all your desktop files and folders? [y/n]: " answer
case "$answer" in
y|Y ) defaults write com.apple.finder CreateDesktop -bool false; echo " Desktop items are hidden! \n";;
n|N ) defaults write com.apple.finder CreateDesktop -bool true; echo " Desktop items are showing! \n";;
* ) echo " Invalid option.. Exiting. \n";;
esac
killall Finder
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment