Created
November 7, 2016 03:15
-
-
Save fpgaminer/bdd493ce84eafb7886e08d20c27b0077 to your computer and use it in GitHub Desktop.
Downloads a random image from Unsplash and sets the wallpaper every so often (currently only works with Gnome/Unity/Cinnamon/etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while : | |
do | |
wget -q -O unsplash_wallpaper.jpg https://unsplash.it/1920/1080/?random | |
gsettings set org.gnome.desktop.background picture-uri file://$PWD/unsplash_wallpaper.jpg | |
sleep 1h # Change this if you want a different update frequency (e.g. 30m, 12h, 24h, etc...). | |
done |
I found this page after searching earlier today. I decided to your your idea and came up with this:
#!/bin/bash
function unsplash {
local FILENAME=unsplash-$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 10;echo)
wget -q -O $FILENAME.jpg https://unsplash.it/1920/1080/?random
echo $FILENAME.jpg
convert -geometry 450x $FILENAME.jpg $FILENAME-450w.jpg
convert -geometry 800x $FILENAME.jpg $FILENAME-800w.jpg
}
unsplash
Generates 3 random files.
- unsplash-RANDOMUUID.jpg
- unsplash-RANDOMUUID-450w.jpg
- unsplash-RANDOMUUID-800w.jpg
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's for OSX.
If you want curl instead just replace the
wget
line.