Fix a theme switch always jumping back to the theme's first wallpaper
Symptom
Each theme ships several wallpapers. You pick the third one for Tokyo Night, switch to Catppuccin, then switch back to Tokyo Night, and you get the first wallpaper again, not the one you chose.
Cause
choose_theme_background in bin/omarchy-theme-set compares readlink of ~/.local/state/omarchy/current/background against the *new* theme's files. That symlink points into current/theme/backgrounds/, which the same script has just rm -rf'd and replaced, so the path can never match and it falls through to backgrounds[0]. There is also no per-theme record of the last choice anywhere on disk.
Fix
There is no built-in per-theme memory yet. Record and restore it yourself with a theme-set hook:
mkdir -p ~/.config/omarchy/hooks/theme-set.d ~/.local/state/omarchy/bg-memory
cat > ~/.config/omarchy/hooks/theme-set.d/90-remember-bg.sh <<'EOF'
#!/bin/bash
set -euo pipefail
state=~/.local/state/omarchy
mem=$state/bg-memory
theme=$(cat "$state/current/theme.name")
want="$mem/$theme"
if [[ -f $want ]]; then
candidate="$state/current/theme/backgrounds/$(cat "$want")"
[[ -f $candidate ]] && omarchy-theme-bg-set "$candidate"
fi
EOF
chmod +x ~/.config/omarchy/hooks/theme-set.d/90-remember-bg.sh
And save your pick whenever you choose one:
theme=$(cat ~/.local/state/omarchy/current/theme.name)
basename "$(readlink ~/.local/state/omarchy/current/background)" \
> ~/.local/state/omarchy/bg-memory/"$theme"
Simplest alternative if you only care about one wallpaper per theme: rename your preferred file so it sorts first inside the theme's backgrounds/ directory:
cd ~/.config/omarchy/themes/<theme>/backgrounds
mv 3-favourite.jpg 0-favourite.jpg
omarchy theme set <theme>
Verify
omarchy theme set catppuccin && omarchy theme set tokyo-night && omarchy theme bg current reports the wallpaper you last chose for Tokyo Night, not the first sorted file.