Enter Wal, a script that uses your wallpaper to automatically generate a color palate in your “.Xresorces” file or another convenient location. Creating and changing your entire color scheme on the fly with Wal is super easy. You might also want to check out pywal. It was written by the same developer and works the same way but in Python. At the time of writing this, pywal only supports Python 3.6, which isn’t packaged nor the default version in most distributions.

Install Wal

If you don’t already have one, create a local “bin” folder in your Home directory. It’ll be much easier to work with that way. Enter your new directory and grab Wal from Github, then make it executable. You’ll need to reread your profile file, too, so do that.

The Basics

Wal is very easy to use. You just need to issue the command and tell it which picture to use. The example below created the picture above.

Wal based the new color scheme off of the KDE wallpaper specified in the command. As a general rule Wal will use the darkest color it can find in the image for the background. Take a look at this rather bright image. You still have a black background since it’s the darkest color Wal found.

Running Wal Automatically

You may have already noticed that Wal doesn’t change any other terminals by default. There are a couple of ways to handle running Wal automatically. The first, and easiest, is to add Wal to your “.bashrc” or “.zshrc” file (if you are using zsh). This will reload your most recent Wal settings for your terminal sessions. The -r flag stands for reload. You can do that manually in a new terminal, too. Also, remember that by styling your terminal itself, Wal also styles all of your terminal applications. That doesn’t do you much good on reboot, though. In order to make Wal run automatically when your X Server starts up, you’ll need to add the following line or something similar to your “.xinitrc” file:

i3WM

If you’re interested in Wal, you’re probably running a window manager. i3 is easily the most popular tiling window manager among Linux customization enthusiasts, and Wal can integrate nicely with it.

You can make i3 load colors from the “.Xresources” file which Wal creates. All you need to do is assign your color variables in i3 from “.Xresources.” Wal will reload i3 and the colors will change dynamically. Even though the image above didn’t do so, you can carry the theme through your status bar, too. Choose the colors that you want based on the “.Xresources” numbering scheme.

Other Programs

There’s a complementary script called wal-set that loads changes to other common programs like Dunst and Lemonbar. You can grab the script from Github and place it in your local “bin” directory, too. Once you have it, add it on to your Wal commands with the -o flag. Polybar is a hugely popular window manager menu bar. Like i3, it can load its color values from “.Xresources,” Just set your color variables in your Polybar configuration to “.Xresorces” values. You can modify any program that reads from “.Xresources” with Wal and even more if you get creative with it. Wal is also scriptable, so that adds loads more options, including setting Wal on a timer. Experiment with it and achieve the desktop you’ve been waiting for.