From ded28ab85a197efbdea865d250593cc402e01f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Mom=C4=8Dilovi=C4=87?= Date: Mon, 8 Jan 2024 21:35:34 +0100 Subject: [PATCH] fix(waybar): fix cava creating multiple instances WaybarCava was creating a new instance of cava every time it was executed. This happens when waybar is restarted/wallpaper is changed Fixed by killing cava process referencing the same config Fix: #131 --- config/hypr/scripts/WaybarCava.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh index 77fce82..711f4c6 100755 --- a/config/hypr/scripts/WaybarCava.sh +++ b/config/hypr/scripts/WaybarCava.sh @@ -28,5 +28,8 @@ data_format = ascii ascii_max_range = 7 EOF +# Kill cava if it's already running +pkill -f "cava -p $config_file" + # Read stdout from cava and perform substitution in a single sed command cava -p "$config_file" | sed -u "$dict"