add script to show/hide desktop icons
This commit is contained in:
parent
407a2d3937
commit
4a0932d241
1 changed files with 21 additions and 0 deletions
21
desktop-icons
Executable file
21
desktop-icons
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Toggle the visibility of Desktop icons.
|
||||||
|
|
||||||
|
# Desktop icons are visible if the CreateDesktop setting is missing or
|
||||||
|
# if it exists and is set to 1, true, yes, or on (case insensitive).
|
||||||
|
# Desktop icons are hidden if the CreateDesktop setting exists and
|
||||||
|
# is set to any value other than 1, true, yes, or on.
|
||||||
|
|
||||||
|
# The $icons variable is the value of CreateDesktop if it exists or is
|
||||||
|
# the empty string if it doesn't.
|
||||||
|
|
||||||
|
icons=`defaults read com.apple.finder CreateDesktop 2> /dev/null`
|
||||||
|
|
||||||
|
shopt -s nocasematch
|
||||||
|
case "$icons" in
|
||||||
|
"" | "1" | "true" | "yes" | "on" )
|
||||||
|
defaults write com.apple.finder CreateDesktop 0 && killall Finder;;
|
||||||
|
* )
|
||||||
|
defaults write com.apple.finder CreateDesktop 1 && killall Finder;;
|
||||||
|
esac
|
||||||
Loading…
Reference in a new issue