Extract generic switcher

This commit is contained in:
David Heinemeier Hansson
2026-05-11 15:28:52 -04:00
committed by Ryan Hughes
parent 1e646be7ee
commit 008f0cf7dd
4 changed files with 162 additions and 42 deletions
+6 -10
View File
@@ -6,15 +6,11 @@
# omarchy:aliases=omarchy wallpaper
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
selection_file=$(mktemp)
trap 'rm -f "$selection_file"' EXIT
theme_name=$(cat "$HOME/.config/omarchy/current/theme.name" 2>/dev/null)
current_background=$(readlink -f "$HOME/.config/omarchy/current/background" 2>/dev/null)
OMARCHY_WALLPAPER_SELECTION_FILE=$selection_file \
OMARCHY_STOCK_BACKGROUNDS_DIR="$HOME/.config/omarchy/current/theme/backgrounds" \
OMARCHY_USER_BACKGROUNDS_DIR="$HOME/.config/omarchy/backgrounds/$theme_name" \
quickshell -p "$OMARCHY_PATH/default/quickshell/wallpaper-switcher.qml" >/dev/null
if [[ -s $selection_file ]]; then
cat "$selection_file"
fi
omarchy-menu-images \
--selected "$current_background" \
--namespace "omarchy-wallpaper-switcher" \
"$HOME/.config/omarchy/current/theme/backgrounds" \
"$HOME/.config/omarchy/backgrounds/$theme_name"