spmenu-wiki/pages/Using Pywal with spmenu.md
2023-06-06 18:16:51 +02:00

2.4 KiB

Using Pywal with spmenu

Using Pywal with spmenu is quite trivial, but the steps will vary depending on whether you're using X11 or Wayland. Using Pywal with spmenu on X11 is slightly easier, because you're able to use colors.Xresources which should just work right away.

X11 (with .Xresources)

With .Xresources on X11 the process is very simple. Make sure .Xresources is enabled in ~/.config/spmenu/spmenu.conf, make sure global is set to 1, and make sure you have no themes overriding global.

Then simply run wal to generate a theme, and apply the theme by running xrdb -override ~/.cache/wal/colors.Xresources. After that spmenu should just use the colors as expected.

X11/Wayland (without .Xresources)

A pywal template can be found here. You'll want to create the directory ~/.config/wal/templates if it doesn't already exist and move this file there.

Now that you have the template added, you can run wal to generate the theme. A theme will now be placed in ~/.cache/wal/colors.spmenu which can be installed and enabled either using the argument or by copying it to ~/.config/spmenu/theme.conf.

NOTE: The following instructions do not apply to users of spmenu 2.0.1 and earlier. Users of earlier versions should copy the theme to theme.conf every time a new colorscheme is generated by Pywal.

This part is optional, but if you want your theme to be set every time, you can now edit your spmenu.conf again, and in there you'll want to set themefile to your Pywal cache file. When you're done the file section should look something like this:

/* File options */
file = ( { xresources = 1; // Load .Xresources on startup (0/1)
           global = 1; // Read global .Xresources colors, programs like Pywal use this. (*.color0, *.color1, etc.) (0/1)
           theme = 1; // Load theme (~/.config/spmenu/theme.conf) on runtime
           binds = 1; // Load binds (~/.config/spmenu/binds.conf) on runtime
           themefile = "/home/speedie/.cache/wal/colors.spmenu"; // Path to theme file to load on runtime. NULL means default.
           bindsfile = "NULL"; // Path to binds file to load on runtime. NULL means default.
       } );

Do however note that with this approach, you must set themefile back to NULL the next time you want to use a normal theme, or a theme manager.