This script generates a wallpaper by fetching radar images and combining them with background maps of Catalonia, all sourced from meteo.cat. The wallpaper is then set as the desktop background.
- Downloads the latest radar images from meteo.cat.
- Combines the radar images into a single image.
- Overlays the radar image on top of a background map of Catalonia.
- Sets the resulting image as the desktop wallpaper.
- Python 3.12
- ImageMagick
- Inkscape
- GNOME: gsettings
To install required packages, use:
> pipenv install
Python virtualenv management tool pipenv is required.
To generate the wallpaper and set it as your desktop background, simply run:
> ./meteocat.py
check-dependencies
: Checks if all required dependencies are installed.generate-background
: Downloads and generates the 4K background map of Catalonia.generate-wallpaper
: Generates the wallpaper with the latest radar data (default command).
To schedule this script to run every 6 minutes using systemd timer, you can follow these steps:
-
Create a
.service
file namedmeteocat_wallpaper_generator.service
in the/etc/systemd/system/
directory with the following contents:[Unit] Description=meteo.cat wallpaper generator [Service] Type=oneshot WorkingDirectory=/<<path>>/meteocat ExecStart=/usr/bin/pipenv run ./meteocat.py
- The
WorkingDirectory
directive specifies the absolute path to the directory where the script is located. - The
ExecStart
directive specifies the absolute path to the script.
- The
-
Create a
.timer
file namedmeteocat_wallpaper_generator.timer
in the/etc/systemd/system/
directory with the following contents:[Unit] Description=Run meteo.cat wallpaper generator script every 6 minutes [Timer] OnCalendar=*:0/6 Persistent=true [Install] WantedBy=timers.target
- The
OnCalendar
directive specifies the exact time when the service should be run. In this case, every 6 minutes. - The
Persistent
directive ensures that the service is run even if the system is restarted.
- The
-
Reload the systemd daemon to recognize the new service and timer:
systemctl daemon-reload
-
Start the timer:
systemctl start meteocat_wallpaper_generator.timer
-
Enable the timer so that it starts automatically on boot:
systemctl enable meteocat_wallpaper_generator.timer
-
You can check the status of the timer using the following command:
systemctl list-timers --all
This will show you all the timers that are currently active on your system. You should see your new timer listed there.
This script is provided "as is" without warranty of any kind, express or implied. Use it at your own risk.