A dynamic wezterm theme using background layers to create a cool window and rain effect!
wezterm_theme.mp4
I couldn't find any wezterm configs that had a cool dynamic theme like I was looking for, so I decided to make my own! I borrowed heavily from the wezterm official documentation's Parallax Example and edited an existing wallpaper image I found to break it into a few layers, which I could use with the wezterm configuration to bring my idea to life. The project uses a few different image layers with varying opacity and 'scroll speed' to give the impression of semi see-through window panes and rain.
Setting up the theme is quick and easy!
- If you haven't set up your wezterm configuration file already, do so (I reccomend creating it in
~/.config/wezterm/wezterm.lua
) and add at least the following lines from the quick start guide:
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- and finally, return the configuration to wezterm
return config
- Clone or download the repository to a location of your choosing
- Move the
wezterm-background.lua
file as well as the wholebackground_images
directory to the same directory as yourwezterm.lua
configuration file. Your wezterm config folder should look like this:
┆
├─ wezterm.lua
└─ background_images
├─ city.png
├─ indoors.png
├─ rain_0.png
├─ rain_1.png
├─ rain_2.png
├─ trails_0.png
└─ ...
- Add the following lines to your main wezterm configuration file:
local dynamic_background = require 'wezterm-background'
dynamic_background.apply_to_config(config)
And thats it! You should be good to go!
A few parameters are provided at the top of the wezterm-background.lua
file to allow you to adjust various aspects of the theme. Official documentation on the wezterm background parameters can be found at the official documentation page for wezterm's background configuration.
- The 'dimmer' options correspond to the
hsb
option for a background layer. - The 'opacity' options correspond to the option of the same name for a background layer.
- The 'parallax_scaling_factor' simply multiplies the parallax 'scrolling speed' for all the scrolling layers by the value given. The other values set the base 'scrolling speed'. All of the values correspond to the
parallax
option inside theattachment
option for a background layer.
I was unable to find the source for the 'city' and 'indoors' base images that I used, but I will gladly add those acknowledgements here if I find that out!
Distributed under the MIT License. See LICENSE.txt
for more information.