From f76f7c65dac2ba9be8177e03ea8877f77b345f1f Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 29 Jan 2023 22:45:24 +0100 Subject: [PATCH] Call get_report before while loop in loop() --- home/.config/eww/scripts/volume | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/home/.config/eww/scripts/volume b/home/.config/eww/scripts/volume index 5d9b850..a3585a0 100755 --- a/home/.config/eww/scripts/volume +++ b/home/.config/eww/scripts/volume @@ -64,16 +64,14 @@ get_report() { # Continually run and report every volume change (into stdout) loop() { + get_report pactl subscribe | grep --line-buffered "change" | while read -r _; do get_report done } case "$1" in - "loop") - get_report - loop - ;; + "loop") loop ;; "once") get_report ;; @@ -107,8 +105,5 @@ case "$1" in fi ;; - *) - >&2 echo "Invalid usage, argument '$1' not recognized." - exit 1 - ;; + *) >&2 echo "Invalid usage, argument '$1' not recognized."; exit 1 ;; esac