Skip to content

Instantly share code, notes, and snippets.

@NicholasModesto
Created July 24, 2013 23:12
Show Gist options
  • Save NicholasModesto/6075479 to your computer and use it in GitHub Desktop.
Save NicholasModesto/6075479 to your computer and use it in GitHub Desktop.
#Shell script that toggles files on your OSX desktop.
VAL=$(defaults read com.apple.finder CreateDesktop);
if [ $VAL == 0 ]; then
osascript -e 'tell app "System Events" to display dialog "Your desktop has been restored."'
defaults write com.apple.finder CreateDesktop -bool true
killall Finder
else
osascript -e 'tell app "System Events" to display dialog "Now hiding your desktop."'
defaults write com.apple.finder CreateDesktop -bool false
killall Finder
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment