Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
World Sunlight Map Wallpaper
#!/bin/bash
#
# Changes the wallpaper hourly and displays a projection of the earth with
# a semi-realistic rendered sunglight mapping.
#
# This script will download hourly the "World Sunlight Map" by die.net.
# You can choose the world_sunlight_wallpaper.jpg picture as background image for your Desktop.
# Gnome recognizes file changes and updates the background accordingly.
#
# See:
# - https://www.die.net/earth/rectangular.html
# - https://www.die.net/earth/how.html
#
# Via: http://www.webupd8.org/2009/09/real-time-earth-wallpaper-for-linux.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
You can’t perform that action at this time.