Skip to content

Instantly share code, notes, and snippets.

@technolize
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save technolize/565a0339aa2c0198ee8f to your computer and use it in GitHub Desktop.

Select an option

Save technolize/565a0339aa2c0198ee8f to your computer and use it in GitHub Desktop.
OS X のデスクトップアイコンの表示・非表示を切り替えるやつ
#!/bin/sh
hide_desktop() {
echo "change configuration to hide desktop icons."
defaults write com.apple.finder CreateDesktop -boolean false
}
show_desktop() {
echo "change configuration to display desktop icons."
defaults delete com.apple.finder CreateDesktop
}
restart_finder() {
echo "restarting finder..."
killall Finder
}
usage() {
echo "usage: $(basename $0) [hide|show]"
exit 1
}
case $1 in
"show")
show_desktop
;;
"hide")
hide_desktop
;;
*)
usage
;;
esac
restart_finder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment