Skip to content

Instantly share code, notes, and snippets.

@jgamblin
Created November 12, 2017 02:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgamblin/34d6f28779f4265146832bfdeb5804d2 to your computer and use it in GitHub Desktop.
Save jgamblin/34d6f28779f4265146832bfdeb5804d2 to your computer and use it in GitHub Desktop.
Download an amazing image from unsplash and set it as the background.
#!/bin/bash
mkdir -p ~/Pictures/Wallpapers/unsplash
rm -f ~/Pictures/Wallpapers/unsplash/"$(date +%F)".png
curl -s -L -o ~/Pictures/Wallpapers/unsplash/"$(date +%F)".png "https://unsplash.it/2560/1600/?random" > /dev/null
osascript -e "tell application \"System Events\" to set picture of every desktop to \"~/Pictures/Wallpapers/unsplash/$(date +%F).png\""
killall Dock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment