From 2da8eba48ec402617ddc94119654feb18a224d62 Mon Sep 17 00:00:00 2001 From: nvpie <62638787+pineapples5972@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:58:26 +0000 Subject: [PATCH] Updated sb-volume to use wireplumber This update will use wireplumber's wpctl command to show volume levels on statusbar. --- .local/bin/statusbar/sb-volume | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 84b27113..d2df6c65 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -13,17 +13,9 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -#echoing mute doenst work yet need help here -[ $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep 'MUTED') = true ] && echo 🔇 && exit +wp="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" +vol="$(echo $wp | awk '{print $2}')" -vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d ':' -f 2)" +ismuted="$(echo "$wp" | awk '{print $3}')" -if [ "$vol" -gt "70" ]; then - icon="🔊" -elif [ "$vol" -lt "30" ]; then - icon="🔈" -else - icon="🔉" -fi - -echo "$icon$vol%" +[ -n "$ismuted" ] && echo "🔇"