Files
omarchy/bin/omarchy-theme-next

32 lines
777 B
Plaintext
Raw Normal View History

2025-06-18 21:17:59 +02:00
#!/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
# Set new theme
NEW_THEME=${THEMES[$INDEX]}
ln -nsf $NEW_THEME ~/.config/omarchy/current-theme
2025-06-18 21:45:27 +02:00
# Save next index (wrap around)
echo "$(((INDEX + 1) % TOTAL))" >"$NEXT_THEME_FILE"
2025-06-18 21:17:59 +02:00
# Install theme backgrounds
source ~/.config/omarchy/current-theme/backgrounds.sh
2025-06-18 21:45:27 +02:00
ln -nsf ~/.config/omarchy/backgrounds/catpuccin ~/.config/omarchy/current-backgrounds
# Touch alacritty config to pickup the changed theme
touch ~/.config/alacritty/alacritty.toml
2025-06-18 21:17:59 +02:00
# Restart apps for new theme
pkill -SIGRTMIN+10 waybar
swaybg-next