Dynamic wallpaper with pywal

Photo by Kendal / Unsplash

Let your linux have dynamic wallpaper just like Apple did to their macOS.

Dynamic wallpapers are a great way to personalize your desktop and add some variety to your computer experience. Pywal is a popular tool that allows you to generate colour schemes based on the wallpaper you're using. However, if you want to take it a step further and have a dynamic wallpaper that changes throughout the day, you can use dwall, a tool built on top of Pywal that changes your wallpaper and colour scheme based on the time of day.

Dwall is a dynamic wallpaper manager for Linux that integrates with pywal. Dwall allows you to use multiple wallpapers that change automatically based on various factors. In this article, we will learn how to set up dynamic wallpaper using pywal and dwall.

Here's how you can set up dwall on your Linux system:

Install Pywal and feh:

$ sudo apt-get install python3-pywal feh

Clone the dwall repository:

$ git clone https://github.com/mczachurski/dynamic-wallpaper.git

Go into the dynamic-wallpaper directory and run the install.sh script:

Install dwall

$ cd dynamic-wallpaper 
$ ./install.sh

This will install dwall and set it up to run as a systemd service. You can customize the wallpapers and colour schemes that dwall uses by editing the config.ini file in the dynamic-wallpaper directory.

Setup crontab job

Once dwall is installed, you need to set up a cron job to run the script every minute. Open your crontab file by running the following command:

$ crontab -e

If this is your first time running crontab, you will be prompted to select an editor.

  1. Add the following line to the crontab file:
* * * * * env TERM=xterm DISPLAY=:0 DESKTOP_SESSION=<your desktop session> DBUS_SESSION_BUS_ADDRESS=<your dbus address> /path/to/dwall -s <theme>

Replace /path/to/dynamic-wallpaper with the path to the directory where you cloned the dwall repository.

This command sets the necessary environment variables (TERM, DISPLAY, DESKTOP_SESSION, and DBUS_SESSION_BUS_ADDRESS) and runs the dwall.py script every minute.

This will ensure that dwall starts running automatically every time you log in to your system.

Save and close the crontab file.

That's it! You should now have a dynamic wallpaper that changes throughout the day based on the time of day. You can browse all the available themes on the project's GitHub page.