Reuse the new omarchy-theme-set in omarchy-theme-next

This commit is contained in:
David Heinemeier Hansson
2025-07-14 21:36:15 -07:00
parent bfc8d73300
commit b3338c84b6
2 changed files with 6 additions and 27 deletions

View File

@ -30,22 +30,5 @@ NEXT_INDEX=$(((INDEX + 1) % TOTAL))
NEW_THEME=${THEMES[$NEXT_INDEX]}
NEW_THEME_NAME=$(basename "$NEW_THEME")
# Set current theme
ln -nsf "$HOME/.config/omarchy/backgrounds/$NEW_THEME_NAME" "$HOME/.config/omarchy/current/backgrounds"
ln -nsf "$NEW_THEME" "$HOME/.config/omarchy/current/theme"
# Touch alacritty config to pickup the changed theme
touch "$HOME/.config/alacritty/alacritty.toml"
# Restart for new theme
pkill -SIGUSR2 waybar
makoctl reload
hyprctl reload
# Set new background
ln -nsf $(find "$HOME/.config/omarchy/current/backgrounds/" -type f | head -n 1) "$HOME/.config/omarchy/current/background"
pkill -x swaybg
setsid swaybg -i "$HOME/.config/omarchy/current/background" -m fill &
# Notify of the new theme
omarchy-theme-set $NEW_THEME_NAME
notify-send "Theme changed to $NEW_THEME_NAME" -t 2000