Skip to content

Instantly share code, notes, and snippets.

@g0053
Forked from fpgaminer/unsplash_wallpaper.sh
Created December 1, 2020 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g0053/eaabbf60fc2dc330490fb294165083ee to your computer and use it in GitHub Desktop.
Save g0053/eaabbf60fc2dc330490fb294165083ee 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)
#!/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
@g0053
Copy link
Author

g0053 commented Dec 1, 2020

#!/bin/sh

while :
do
	wget -q -O unsplash_wallpaper.jpg https://unsplash.it/1920/1080/?random
        osascript -e 'tell application "Finder" to set desktop picture to POSIX file "$PWD/unsplash_wallpaper.jpg"'	
	sleep 1h
done

If you want curl instead just replace the wget line.

curl -o unsplash_wallpaper.jpg https://unsplash.it/1920/1080/?random

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment