Last active
August 29, 2015 14:12
-
-
Save adiabatic/820c9d7902d508e1335e to your computer and use it in GitHub Desktop.
Change all backgrounds to either light or dark, depending.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case $1 in | |
light) | |
imageFile="/Library/Desktop Pictures/Solid Colors/Solid White.png" | |
;; | |
dark) | |
imageFile="/Library/Desktop Pictures/Solid Colors/Solid Gray Pro Ultra Dark.png" | |
;; | |
*) | |
imageFile="" | |
;; | |
esac | |
if test -f "$imageFile"; then | |
osascript << EOF | |
tell application "System Events" | |
set N to count of desktops | |
repeat with i from 1 to N | |
tell desktop i to set picture to POSIX file "$imageFile" | |
end repeat | |
end tell | |
EOF | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment