Skip to content

Instantly share code, notes, and snippets.

Created November 3, 2013 22:13
Show Gist options
  • Save anonymous/7295485 to your computer and use it in GitHub Desktop.
Save anonymous/7295485 to your computer and use it in GitHub Desktop.
Setting both desktop pattern images on a dual screen mac. Uses unix file path and is works in a shell script.
dtpat1="/images/screen1image.jpg"
dtpat2="/images/screen2image.jpg"
osascript -e "tell application \"System Events\"" \
-e "set theDesktops to a reference to every desktop" \
-e "set picture of item 1 of the theDesktops to (do shell script \"echo $dtpat1\")" \
-e "set picture of item 2 of the theDesktops to (do shell script \"echo $dtpat2\")" \
-e "end tell"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment