aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfig/hypr/scripts/ThemeChanger.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/config/hypr/scripts/ThemeChanger.sh b/config/hypr/scripts/ThemeChanger.sh
index 1ae1060f..a40a1f18 100755
--- a/config/hypr/scripts/ThemeChanger.sh
+++ b/config/hypr/scripts/ThemeChanger.sh
@@ -39,14 +39,30 @@ if wallust theme -- "${choice}"; then
-h string:x-dunst-stack-tag:themechanger \
"Global theme changed" "Selected: ${choice}"
- # Give wallust a brief moment to finish writing templates
- sleep 0.15
+ # Regenerate templates from the current wallpaper to ensure Wallust rewrites waybar/rofi files
+ start_ts=$(date +%s)
+ wp_cur="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
+ if [ -f "$wp_cur" ]; then
+ wallust run -s "$wp_cur" >/dev/null 2>&1 || true
+ fi
+
+ # Wait until template targets exist and are non-empty/newer than the start time
+ targets=("$HOME/.config/waybar/wallust/colors-waybar.css" "$HOME/.config/rofi/wallust/colors-rofi.rasi")
+ for i in $(seq 1 40); do
+ ok=1
+ for f in "${targets[@]}"; do
+ if [ ! -s "$f" ]; then ok=0; break; fi
+ mtime=$(stat -c %Y "$f" 2>/dev/null || echo 0)
+ if [ "$mtime" -lt "$start_ts" ]; then ok=0; break; fi
+ done
+ [ $ok -eq 1 ] && break
+ sleep 0.1
+ done
- # Prefer the same refresh path used by WallpaperSelect to avoid CSS race/fallbacks
+ # Refresh bars/menus after files are in place
if [ -x "$HOME/.config/hypr/scripts/Refresh.sh" ]; then
"$HOME/.config/hypr/scripts/Refresh.sh" >/dev/null 2>&1 || true
else
- # Fallback: reload Waybar only
if command -v waybar-msg >/dev/null 2>&1; then
waybar-msg cmd reload >/dev/null 2>&1 || true
else
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage