Tutorials
Tutorial: Add a Wallpaper → Theme
Drop an image. Get a terminal theme whose text colours meet WCAG AAA (7:1) contrast.
Prerequisites
- Dotfiles installed (see First Install)
magick(ImageMagick) andpython3available- Optional:
heif-encfor creating dynamic HEIC (brew install libheif)
Option A: Drop a Static Image
The simplest path: place a wallpaper in ~/Pictures/Wallpapers/ (or $DOTFILES_WALLPAPER_DIR) and rebuild. A file named <name>-dark.<ext> or <name>-light.<ext> becomes that one variant; a single image without a suffix is themed in both modes, as <name>-dark and <name>-light.
The output has this shape (the counts depend on your library and the cache):
Discovering wallpapers...
Found: <system> system, <custom> custom wallpapers (<total> total → <n> light/dark themes)
Generating themes...
Processing <n> wallpapers (4 parallel jobs)...
mytheme-dark [custom] ✓
mytheme-light [custom] ✓
Results: <n> generated, <n> cached, <n> failed
Assembling themes.toml...
Written: ~/.dotfiles/defaults/.theme-manifest/themes.toml (<n> themes)
Done. Run 'dot theme list' to see available themes.
Switch to the new theme:
Option B: Dynamic HEIC (Recommended)
Apple's dynamic HEIC format stores both dark and light variants in a single file with metadata that macOS uses to auto-switch appearance. This is the native format for Apple system wallpapers.
Create a Dynamic HEIC From a Pair
If you have mytheme-dark.jpg + mytheme-light.jpg:
This:
- Finds
mytheme-darkandmytheme-light(.heic,.jpgor.png) in the wallpaper directory - Converts both to JPEG and encodes them into one
.heicwithheif-enc(image 0 = light, image 1 = dark) - Injects the
apple_desktop:aprXMP appearance metadata, ifexiftoolis installed (the step is skipped silently otherwise) - Writes
~/Pictures/Wallpapers/mytheme.heic - Removes the two source files
--dry-run shows what would be merged without writing anything.
Verify that the file holds two images:
Rebuild Themes
A multi-frame HEIC is registered as mytheme-light (frame 0) and mytheme-dark (frame 1), and each frame is themed on its own.
Option C: Golden Ratio Brightness (Advanced)
For a clear difference between your dark and light variants, a brightness ratio of about 1.6 (close to the golden ratio, 1.618) between the two images works well. This is a rule of thumb for preparing images; the engine does not check it.
Measure:
# 0.30
# 0.48
# Ratio: 0.48 / 0.30 = 1.6 ← ideal
Adjust a pair if the ratio is off:
# Darken light to 0.485 brightness
mod= # current mean = 0.60
Option D: Use System Wallpapers
The wallpapers that ship with the OS (/System/Library/Desktop Pictures on macOS, /usr/share/backgrounds and /usr/share/wallpapers on Linux) are opt-in. Set DOTFILES_THEME_SYSTEM=1 to include them; a custom wallpaper with the same name wins.
List what would be themed, without rebuilding:
DOTFILES_THEME_SYSTEM=1
The listing has a NAME, SOURCE (system or custom) and PATH column, one row per theme variant, and ends with Total: <n> wallpapers.
Rebuild with them, then switch:
DOTFILES_THEME_SYSTEM=1
The engine extracts the wallpaper's dominant colours, generates a palette, and applies it to every surface.
Verifying the Result
After a switch, check the applied colors:
# See the current theme's palette
Check WCAG compliance. The generator forces every text colour to a 7:1 ratio, and this test checks every theme in themes.toml:
Verify the applied wallpaper:
# macOS
# Linux (GNOME)
Troubleshooting
The Theme Is Missing From the Picker
dot theme list and the picker show only families that have both a -dark and a -light theme. If you added only mytheme-dark.jpg, add the light image too, or use a single unsuffixed image, which is themed in both modes.
Muddy or Flat Palette
The engine runs K-Means three times with fixed seeds and keeps the best clustering. Images that are nearly one solid colour give few distinct clusters, so the palette has little variety. Fix: use a more chromatic source image.
Wallpaper Doesn't Apply on Linux
On Linux, dot theme hands the wallpaper to DMS (Dank Material Shell, dms ipc) when dms is installed, and then to the first of these it finds:
gsettings(GNOME and similar):picture-uriandpicture-uri-dark(a HEIC is converted to PNG first)swaybgfeh
If none is found it reports Wallpaper setter not found (gsettings/swaybg/feh).
The Dark/Light Auto-Switch Isn't Working on macOS
The apple_desktop:apr metadata may be missing. Verify:
|
If empty, exiftool was probably missing when you merged: install it and merge the pair again.
Summary
You've added a custom wallpaper, generated a WCAG AAA theme from it, and checked that it applied. You can now:
- Add more wallpapers to build a library
- Share your wallpaper directory across hosts (it lives outside the repository, in
~/Pictures/Wallpapers/) - Use
dot theme toggleto swap dark↔light of your current family