A simple script to set certain wallpapers at various times during the day depending on the current daylight at your location.
The script will try to guess the location if no coordinates are provided. However, it's faster and more precise to set the coordinates manually as described below.
You can use this with any type of pictures, but it works very well with landscape photos that change as the day progresses, such as used by a very popular closed source operating system based in California. I'm sure you can find such pictures by using your favorite search engine, I don't want to include any for copyright reasons. But it will work with any images you seem fit. Just rename the files in accordance with the help text instructions.
I recommend using this with cron and a few environment variables as such:
*/10 * * * * . $HOME/.profile; DISPLAY=:0 /usr/bin/bash $HOME/bin/daylight_wallpaper.sh -x $LATITUDE -y $LONGITUDE -f $WALLPAPER_FOLDER
The following works very well on Ubuntu 20.04:
*/10 * * * * . $HOME/.profile; DISPLAY=:0.0 dbus-launch --exit-with-session /usr/bin/bash $HOME/bin/daylight_wallpaper.sh -x $LATITUDE -y $LONGITUDE -f $WALLPAPER_FOLDER -g
Set the $LATITUDE
, $LONGITUDE
, and $WALLPAPER_FOLDER
variables in your
~/.profile
or similar.
You can also write them out explicitly.
This script uses the API at Sunrise-Sunset as well as IP-API.