LinuxCommandLibrary

wal

Change system colorscheme from an image

TLDR

Preview color scheme

$ wal --preview [image.png]
copy

Create color scheme
$ wal -i [image.png]
copy

Create a light color scheme
$ wal -i [image.png] -l
copy

Skip setting the desktop wallpaper
$ wal -i [image.png] -n
copy

Skip setting the terminal colors
$ wal -i [image.png] -s
copy

Restore the previously generated color scheme and wallpaper
$ wal -R
copy

SYNOPSIS

wal [OPTIONS] [IMAGE_PATH]

PARAMETERS

-i, --image /path/to/image.jpg
    Specify the input image path from which to generate the colorscheme.

-s, --store
    Store the generated colorscheme for later use. This makes it the default on subsequent runs without specifying an image.

-t, --theme theme_name
    Use a predefined theme instead of generating one from an image. Themes are typically located in ~/.config/wal/themes/.

-e, --external command
    Execute an external command after the colorscheme has been applied. This is useful for triggering reloads in applications that need it.

-r, --reload
    Reload the current colorscheme without regenerating it from an image. Useful if you've manually edited the cache files.

--backend backend_name
    Specify the color extraction backend to use (e.g., wal, colorz, dominant, haishoku). Each may produce slightly different results.

--saturate value
    Increase the saturation of the generated colors. A value like 0.8 or 1.2 can be used for desaturation or oversaturation, respectively.

--light
    Generate a light colorscheme instead of the default dark one.

--alpha value
    Set the transparency level for terminal colors. Expects a value between 0 (fully transparent) and 100 (fully opaque).

--vte
    Update VTE-based terminals (like Gnome Terminal, Tilix) by trying to apply the colorscheme directly. This often requires the VTE patch.

--preview
    Show a preview of the generated colorscheme in the terminal without applying it system-wide.

--config /path/to/config_dir
    Specify an alternative configuration directory for pywal instead of the default ~/.config/wal/.

--clear
    Remove all generated colorscheme files from the cache directory (~/.cache/wal/).

--iterative
    Continuously update the colorscheme whenever the input image changes. Requires a tool like inotifywait.

DESCRIPTION

wal, commonly known as pywal, is a powerful Python-based command-line tool that automatically generates a vibrant color palette from your desktop background image. It then applies this colorscheme system-wide to various applications, including terminal emulators, text editors, and other UI elements, providing a consistent and aesthetically pleasing visual experience. pywal achieves this by generating configuration files for programs like Xresources, GTK, Qt, and various terminal emulators, ensuring your desktop environment harmonizes with your chosen wallpaper. It's widely used by customization enthusiasts to achieve a highly personalized and dynamic desktop appearance, eliminating the need for manual color configuration.

CAVEATS

pywal requires Python 3 and its dependencies to be installed. It primarily affects Xorg-based desktop environments and may require specific terminal emulators (e.g., Kitty, Alacritty, iTerm2, or VTE-based terminals with wal's VTE patch) and application configurations to fully integrate. Not all applications support dynamic theme changes without manual configuration or specific pywal integration scripts. Some applications might need to be restarted to pick up the new colorscheme.

CONFIGURATION FILES

pywal typically generates configuration files in ~/.cache/wal/. These include colors (raw color values), colors.json (JSON representation), and theme files for various applications like colors-kitty.conf, colors-alacritty.yml, colors-xresources, colors-waybar.css, etc. These files are then sourced or applied by the respective applications to update their appearance.

INTEGRATION WITH SHELL

For the colorscheme to be applied to your shell prompt and terminal, pywal often instructs users to add a line like (cat ~/.cache/wal/colors.sh) or source ~/.cache/wal/colors.sh to their shell's configuration file (e.g., .bashrc, .zshrc, .config/fish/config.fish). This script sets environment variables and Xresources based on the generated theme, ensuring your terminal's colors match your wallpaper.

HISTORY

pywal emerged from the desire to automatically theme the desktop based on the wallpaper, simplifying the process of creating a cohesive visual style. It gained significant popularity within the Linux customization community, particularly among users of tiling window managers and those who share their configurations on platforms like Reddit's r/unixporn, due to its ability to create dynamic and consistent themes with minimal effort. Its development has been driven by community contributions, adding support for a wide array of applications and improving color extraction accuracy.

SEE ALSO

feh(1): Lightweight image viewer, commonly used for setting wallpapers which pywal can then process., nitrogen(1): A wallpaper browser and setter, another common tool in wallpaper management with pywal., xrdb(1): X resource database utility, often used by pywal to set X colors for older applications and environments., dunst(1): A highly customizable notification daemon, often configured by pywal to match the system theme., kitty(1): A fast, feature-rich, GPU-based terminal emulator, one of the most popular choices for direct pywal integration., alacritty(1): A GPU-accelerated terminal emulator, another modern terminal often paired with pywal.

Copied to clipboard