Add different themes

This commit is contained in:
David Heinemeier Hansson
2025-06-18 21:17:59 +02:00
parent 0269ee55d9
commit e09c0477aa
20 changed files with 362 additions and 113 deletions

27
bin/omarchy-theme-next Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
THEMES_DIR="$HOME/.config/omarchy/themes/"
NEXT_THEME_FILE="$HOME/.cache/next_theme_index"
THEMES=($(find "$THEMES_DIR" -mindepth 1 | sort))
TOTAL=${#THEMES[@]}
if [[ ! -f "$NEXT_THEME_FILE" ]]; then
INDEX=0
else
INDEX=$(<"$NEXT_THEME_FILE")
fi
# Save next index (wrap around)
echo "$(((INDEX + 1) % TOTAL))" >"$NEXT_THEME_FILE"
# Set new theme
NEW_THEME=${THEMES[$INDEX]}
ln -nsf $NEW_THEME ~/.config/omarchy/current-theme
# Install theme backgrounds
source ~/.config/omarchy/current-theme/backgrounds.sh
# Restart apps for new theme
pkill -SIGRTMIN+10 waybar
swaybg-next

View File

@ -2,7 +2,7 @@
# Cycles through the background images available
BACKGROUNDS_DIR="$HOME/.local/share/backgrounds"
BACKGROUNDS_DIR="$HOME/.config/omarchy/current-backgrounds/"
NEXT_BACKGROUND_FILE="$HOME/.cache/next_background_index"
BACKGROUNDS=($(find "$BACKGROUNDS_DIR" -type f | sort))
@ -15,7 +15,7 @@ else
fi
# Save next index (wrap around)
echo "$(( (INDEX + 1) % TOTAL ))" > "$NEXT_BACKGROUND_FILE"
echo "$(((INDEX + 1) % TOTAL))" >"$NEXT_BACKGROUND_FILE"
# Launch swaybg
pkill -x swaybg