From 68a7844037c52fabe3317e63e8d6c17213f9ae2d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 4 Feb 2026 14:59:37 -0500 Subject: waybar-cava processes getting started on every waybar config change These changes kill those processes On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/Refresh.sh modified: config/hypr/scripts/WaybarCava.sh --- config/hypr/scripts/Refresh.sh | 3 +++ config/hypr/scripts/WaybarCava.sh | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 76757aa4..b998b14c 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -22,6 +22,9 @@ for _prs in "${_ps[@]}"; do fi done +# Clean up any Waybar-spawned cava instances (unique temp conf names) +pkill -f 'waybar-cava\..*\.conf' 2>/dev/null || true + # added since wallust sometimes not applying killall -SIGUSR2 waybar # Added sleep for GameMode causing multiple waybar diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh index 6809e60e..98a8d7f9 100755 --- a/config/hypr/scripts/WaybarCava.sh +++ b/config/hypr/scripts/WaybarCava.sh @@ -10,6 +10,9 @@ if ! command -v cava >/dev/null 2>&1; then exit 1 fi +# Proactively reap any stale Waybar-spawned cava (unique temp conf names) +pkill -f 'waybar-cava\..*\.conf' 2>/dev/null || true + # 0..7 → ▁▂▃▄▅▆▇█ bar="▁▂▃▄▅▆▇█" dict="s/;//g" @@ -32,7 +35,11 @@ printf '%d' $$ >"$pidfile" # Unique temp config + cleanup on exit config_file="$(mktemp "$RUNTIME_DIR/waybar-cava.XXXXXX.conf")" -cleanup() { rm -f "$config_file" "$pidfile"; } +cleanup() { + # Kill children (cava, sed) of this script, then remove files + pkill -P "$$" 2>/dev/null || true + rm -f "$config_file" "$pidfile" +} trap cleanup EXIT INT TERM cat >"$config_file" <