mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
28 lines
596 B
Plaintext
28 lines
596 B
Plaintext
![]() |
#!/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
|