Tutorials
Tutorial: Add a Wallpaper → Theme
Drop an image. Get a fully-WCAG-AAA terminal theme.
Prerequisites
- Dotfiles installed (see First Install)
magick(ImageMagick) andpython3available (installed by default)- Optional:
heif-encfor creating dynamic HEIC (brew install libheif)
Option A: Drop a Static Image
The simplest path: place a wallpaper in ~/Pictures/Wallpapers/ and rebuild.
Expected output:
Discovering wallpapers...
Found: 126 system, 26 custom (152 total)
Generating themes...
Processing 2 wallpapers (4 parallel jobs)...
mytheme-dark [custom] ✓
mytheme-light [custom] ✓
Results: 2 processed, 150 cached, 0 failed
Assembling themes.toml...
Written: ~/.dotfiles/.chezmoidata/themes.toml (608 theme sections)
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:
- Resizes both to 6016×6016 (preserving aspect ratio, center-cropped)
- Encodes both into a single
.heicviaheif-enc - Injects
apple_desktop:aprXMP metadata (image 0 = light, image 1 = dark) - Writes to
~/Pictures/Wallpapers/mytheme.heic - Removes the two source files
Verify:
# image: 6016x6016 (id=1), primary ← light
# image: 6016x6016 (id=4) ← dark
# metadata:
# XMP: 2473 bytes ← appearance mapping
Rebuild Themes
# mytheme-light [custom] ✓
# mytheme-dark [custom] ✓
The engine extracts each frame independently and generates paired themes.
Option C: Golden Ratio Brightness (Advanced)
For best perceived contrast between your dark and light themes, target a brightness ratio of ~1.6× (the golden ratio, approximately 1.618).
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: Install System Wallpapers (Already-Available)
macOS ships dozens of wallpapers you can use directly — no download needed.
List what's available:
Output:
NAME SOURCE PATH
---- ------ ----
monterey-dark system /System/Library/Desktop Pictures/.thumbnails/Monterey Dark.heic
monterey-light system /System/Library/Desktop Pictures/.thumbnails/Monterey Light.heic
tahoe-dark system /System/Library/Desktop Pictures/.thumbnails/Tahoe Dark.heic
tahoe-light system /System/Library/Desktop Pictures/.thumbnails/Tahoe Light.heic
sonoma-dark system /System/Library/Desktop Pictures/.thumbnails/Sonoma Dark.heic
...
Total: 152 wallpapers
Switch to any system wallpaper:
The engine extracts Monterey Dark's dominant colors, 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 (always passes for generated themes):
# RESULTS: 11:11:0 (11 tests, 11 passed, 0 failed)
Verify the applied wallpaper:
# macOS
# Linux (GNOME)
Troubleshooting
Low Contrast on Both Variants
Your wallpaper pair doesn't have enough brightness difference. The theme will still generate but dot theme list may filter it from the picker. Adjust the source images to increase separation (brighter light variant, darker dark variant).
K-Means Failed to Converge
Rare, but possible with images that are nearly solid color. The engine uses a seeded RNG and 3 runs — if all 3 fail, the output theme is skipped. Fix: use a more chromatic source image.
Wallpaper Doesn't Apply on Linux
Check your desktop environment:
- GNOME — uses
gsettings picture-uri(HEIC auto-converted to PNG) - KDE — uses
plasma-apply-wallpaperimage - Niri — uses DMS IPC or
swaybg - i3/sway (no DE) — falls back to
feh
If none are detected, set $WALLPAPER_COMMAND in ~/.config/dotfiles/config.
The Dark/Light Auto-Switch Isn't Working on macOS
The apple_desktop:apr metadata may be missing. Verify:
|
If empty, re-run merge-wallpaper.sh — the XMP injection step may have failed due to missing exiftool.
Summary
You've added a custom wallpaper, generated a WCAG AAA theme from it, and verified cross-surface application. You can now:
- Add more wallpapers to build a library
- Share your wallpaper directory across fleet hosts (it's gitignored by default)
- Use
dot theme toggleto swap dark↔light of your current family