Skip to content

Instantly share code, notes, and snippets.

@Graham42
Created October 20, 2018 19:52
Show Gist options
  • Save Graham42/4fd8ca6b3f99d37b63713d5cdb7247a7 to your computer and use it in GitHub Desktop.
Save Graham42/4fd8ca6b3f99d37b63713d5cdb7247a7 to your computer and use it in GitHub Desktop.
mkdir -p ~/Pictures/Wallpapers
WIDTH=1280
HEIGHT=800
RANDOM_NAME=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
curl -JL -o "$HOME/Pictures/Wallpapers/${RANDOM_NAME}.jpeg" https://picsum.photos/g/$WIDTH/$HEIGHT?random
osascript -e "tell application 'Finder' to set desktop picture to POSIX file '$HOME/Pictures/Wallpapers/${RANDOM_NAME}.jpeg'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment