From 4a8131b166c4ba2512d075dcf5cc930ca1652bd8 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 20 Sep 2025 12:20:28 -0400 Subject: fix(wallust): make theme regeneration deterministic on wallpaper change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Accept explicit image path in WallustSwww.sh; retry swww cache briefly if not provided - Pass selected image path from WallpaperSelect.sh to WallustSwww.sh - Run WallustSwww.sh synchronously in RefreshNoWaybar.sh to ensure colors are ready before reload - Update WallpaperAutoChange.sh to call WallustSwww.sh with each rotated image This eliminates races against swww’s cache and ensures Wallust updates waybar/rofi/kitty/hypr colors immediately after changing wallpapers. Test plan: - Select a wallpaper (SUPER+W): observe updated files in ~/.config/{waybar,rofi,kitty}/ and immediate border color changes; waybar reloads with new palette - Enable auto-rotate (WallpaperAutoChange.sh): colors now update on each rotation without manual intervention Tested-by: KalebNH --- config/hypr/UserScripts/WallpaperAutoChange.sh | 5 ++++- config/hypr/UserScripts/WallpaperSelect.sh | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index f54620bb..a6d2cedd 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -31,7 +31,10 @@ while true; do done \ | sort -n | cut -d':' -f2- \ | while read -r img; do - swww img -o $focused_monitor "$img" + swww img -o $focused_monitor "$img" + # Regenerate colors from the exact image path to avoid cache races + $HOME/.config/hypr/scripts/WallustSwww.sh "$img" + # Refresh UI components that depend on wallust output $wallust_refresh sleep $INTERVAL diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index a6e6c4d4..a08b53ce 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -168,8 +168,8 @@ apply_image_wallpaper() { swww img -o "$focused_monitor" "$image_path" $SWWW_PARAMS - # Run additional scripts - "$SCRIPTSDIR/WallustSwww.sh" + # Run additional scripts (pass the image path to avoid cache race conditions) + "$SCRIPTSDIR/WallustSwww.sh" "$image_path" sleep 2 "$SCRIPTSDIR/Refresh.sh" sleep 1 -- cgit v1.2.3