Skip to content

Instantly share code, notes, and snippets.

@jagamypriera
Forked from dmpop/unsplash-random.sh
Last active March 24, 2017 08:49
Show Gist options
  • Save jagamypriera/0ae0f52571b87c0762108b376141ac46 to your computer and use it in GitHub Desktop.
Save jagamypriera/0ae0f52571b87c0762108b376141ac46 to your computer and use it in GitHub Desktop.
Use random photos from Unsplash as a desktop background on Elementary OS
#!/bin/bash
path="/path/to/directory/"
size=$(xdpyinfo | grep dimensions | awk '{print $2}')
downloaded=$(date +%Y%m%d%H%M%S)
IFS='x' read -ra size <<< "$size"
curl "https://unsplash.it/${size[0]}/${size[1]}/?random" --location --output $path/unsplash-random-$downloaded.jpeg
gsettings set org.gnome.desktop.background picture-uri file://$path/unsplash-random-$downloaded.jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment