Skip to content

Instantly share code, notes, and snippets.

@thecoolwinter
Created May 20, 2021 18:35
Show Gist options
  • Save thecoolwinter/c10be33d62b6653445dbccd3f36e8551 to your computer and use it in GitHub Desktop.
Save thecoolwinter/c10be33d62b6653445dbccd3f36e8551 to your computer and use it in GitHub Desktop.
Quickly toggle your desktop icons with a simple script. Can also be used in an Automator script as an application.
#!/usr/bin/env zsh
previous_val=$(defaults read com.apple.finder CreateDesktop)
if [ "$previous_val" = "true" ]
then
previous_val=$(echo 'false');
else
previous_val=$(echo 'true')
fi
defaults write com.apple.finder CreateDesktop $previous_val
killall Finder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment