Skip to content

Instantly share code, notes, and snippets.

@kishorviswanathan
Created May 9, 2020 05:03
Show Gist options
  • Save kishorviswanathan/48d1fb5fe92ebd53525485e85232af2a to your computer and use it in GitHub Desktop.
Save kishorviswanathan/48d1fb5fe92ebd53525485e85232af2a to your computer and use it in GitHub Desktop.
#!/bin/bash
tag=$1
tmpfile=/tmp/`openssl rand -base64 10 | tr -cd '[:alpha:][:digit:]'`.jpg
echo "Downloading"
curl -Ls "https://source.unsplash.com/2880x1800/?$tag" -o "$tmpfile"
echo "Setting wallpaper"
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$tmpfile\""
sleep 5
rm -rf $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment