Skip to content

Instantly share code, notes, and snippets.

@drbh
Created June 5, 2018 17:43
Show Gist options
  • Select an option

  • Save drbh/480db9901d305f24cba5fa06eeaef378 to your computer and use it in GitHub Desktop.

Select an option

Save drbh/480db9901d305f24cba5fa06eeaef378 to your computer and use it in GitHub Desktop.
toggle desktop icons on mac
hide_desktop_icons(){
defaults write com.apple.finder CreateDesktop false && killall Finder
}
show_desktop_icons(){
defaults write com.apple.finder CreateDesktop true && killall Finder
}
toggle_icons(){
if [ "$(defaults read com.apple.finder CreateDesktop)" == "false" ]; then
echo "Showing Icons"
show_desktop_icons
else
echo "Hiding Icons"
hide_desktop_icons
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment