Skip to content

Instantly share code, notes, and snippets.

@ryan-mooore
Created August 2, 2021 12:58
Show Gist options
  • Save ryan-mooore/45c1878da24171ae96e399266cccd08c to your computer and use it in GitHub Desktop.
Save ryan-mooore/45c1878da24171ae96e399266cccd08c to your computer and use it in GitHub Desktop.
One-liner to download and use a random Google Earth View (earthview.withgoogle.com) satellite image as your macOS wallpaper. Must have jq installed.
#!/bin/bash
rint=$(($RANDOM % 2608)) && curl -s "https://www.gstatic.com/prettyearth/assets/full/"$(curl -s https://earthview.withgoogle.com/_api/photos.json | jq --arg i $rint '.[$i | tonumber].slug' | sed 's/[^0-9]*//g')".jpg" -o earthview.jpg --output-dir $TMPDIR && osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \""$TMPDIR"earthview.jpg\"" && killall Dock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment