Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

User Template Files

Dylan Araps edited this page Feb 1, 2018 · 7 revisions

As of version 1.0.0 pywal now supports user defined template files. What this means is that similar to the export files in the ~/.cache/wal/ directory you can now create your own files which will be processed by pywal and spit out in this directory.

The user defined files are read from ~/.config/wal/templates/ and are exported to ~/.cache/wal/ under the same name. Using this feature you can also overwrite the default export files, here's an example using rofi.

The default rofi configuration in pywal is a black background with white text. Say you want to invert these colors and have a white background with black text, here are the steps to do so.

  1. Find the default template file.
  2. Create a file called colors-rofi.rasi in ~/.config/wal/templates.
  3. Define your own colors for rofi using the values you want based on the original template.
// Example snippet.
* {{
    active-background: {color2};
    active-foreground: {foreground};
    normal-background: {background};
    normal-foreground: {foreground};
    urgent-background: {color1};
    urgent-foreground: {foreground};
    // ...
}}
  1. Rerun wal to apply the new settings.

Available variables and syntax.

pywal's templating works by using Python's string formatting so it's builtin, quick and simple. Variables must be surrounded by {/} to be recognized and any existing curly-braces need to be escaped. To escape curly-braces you just double them, so { becomes {{ and so on.

Variables

  • {color0} --> {color15}: Colors 0-15.
  • {background}: Background color.
  • {foreground}: Foreground color.
  • {cursor}: Cursor color.
  • {wallpaper}: The full path to the current wallpaper.

Modifiers

Note: These apply to all variables minus wallpaper.

  • {var}: Output the color in hex.
  • {var.rgb}: Output the color in rgb.
  • {var.xrgba}: Output the color in xrgb.
  • {var.strip}: Output the color in hex (without a #).

Clone this wiki locally