Updated sb-volume to use wireplumber

This update will use wireplumber's wpctl command to show volume levels on statusbar.
This commit is contained in:
nvpie 2022-08-16 15:58:26 +00:00 committed by GitHub
parent 86b8a678ee
commit 2da8eba48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 "🔇"