This Bash script creates an animated, self-updating desktop wallpaper using the latest infrared satellite images of Europe from the Royal Meteorological Institute of Belgium (RMI / KMI).
Here is exactly what it does step-by-step:
1. InitializationIt sets up a working directory (~/sat_images) to store the images.
It defines a set_wallpaper helper function that checks which desktop environment or window manager is running (pcmanfm, wayfire, or labwc) and applies the wallpaper using the correct command line tool for that system.
The script runs continuously in a while true loop, executing two main phases every 5 minutes:
Scrapes URLs: It uses curl to download the HTML page from the RMI website and pulls out all .jpg image links. It sorts them and takes the last 4 links (the most recent images).
Cleans old files: If new images are found, it deletes the previous cycle's images to save space.
Downloads & Converts: It downloads the 4 JPEG images (temp_1.jpg to temp_4.jpg) and uses the convert tool (from ImageMagick) to turn them into PNG files (wall_1.png to wall_4.png).
Once downloaded, the script enters a smaller inner loop that runs 60 times:
It updates your desktop wallpaper to the next satellite image in the sequence (wall_1, then wall_2, wall_3, wall_4).
It pauses for 5 seconds before switching to the next image.
Once it hits the final image, it loops back to the first one.
SummaryThe end result for the user is an animated weather radar wallpaper that cycles through a 4-frame time-lapse animation every 5 seconds. Every 5 minutes, the script seamlessly connects back to the internet, downloads the newest radar frames, and updates the animation cycle.




Comments