From f3fae543a71bbfb52341400e1d919cba75da7967 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 20 Jul 2022 15:08:50 +0300 Subject: [PATCH] scripts: fix get volume script --- programs/xmonad/xmobar/scripts/get_volume.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/programs/xmonad/xmobar/scripts/get_volume.sh b/programs/xmonad/xmobar/scripts/get_volume.sh index 50540bd..4393738 100755 --- a/programs/xmonad/xmobar/scripts/get_volume.sh +++ b/programs/xmonad/xmobar/scripts/get_volume.sh @@ -1,9 +1,8 @@ #!/bin/bash -res=$(amixer -D pulse sget Master) -enabled=$(echo $res | egrep -o "\[on\]" | wc -l) +enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l) if [[ $enabled == "0" ]]; then echo "off" else - echo $(echo $res | egrep -o "[0-9]+%" | head -n 1) + echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1) fi exit 0