Skip to content

Instantly share code, notes, and snippets.

@thet
Created February 17, 2017 10:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thet/786af731423e757eff280abeeff1129f to your computer and use it in GitHub Desktop.
Save thet/786af731423e757eff280abeeff1129f to your computer and use it in GitHub Desktop.
Live Earth Wallpaper Changer for Linux
#!/bin/bash
#
# Changes the wallpaper hourly and displays a projection of the earth with
# a semi-realistic rendered sunglight mapping.
#
# Via: http://www.webupd8.org/2009/09/real-time-earth-wallpaper-for-linux.html
# More Info:
# - https://www.die.net/earth/rectangular.html
# - https://www.die.net/earth/how.html
#
cd ~/Pictures/Wallpapers
while [ 1 ]; do
COUNTER=0
while [ $COUNTER -lt 60 ]; do
wget http://www.opentopia.com/images/cams/world_sunlight_map_rectangular.jpg -O world.jpg
temp=$(stat -c%s world.jpg)
if [[ $temp > 1000 ]]; then
mv world_sunlight_wallpaper.jpg world-sunlight-archive/world_sunlight_wallpaper-$(date +%F-%T).jpg
mv world.jpg world_sunlight_wallpaper.jpg
break
fi
sleep 5
let COUNTER=COUNTER+1
done
sleep 3600
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment