Making sb-volume work with wireplumber

Due to latest arch and artix update most has to switch on pipewire and wireplumber. This script make uses wireplumber commands to display volume information on statusbars. However it still needs mute function to be fixed. I replaced what i could.
This commit is contained in:
nvpie 2022-08-14 16:47:13 +00:00 committed by GitHub
parent 606905268f
commit 86b8a678ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,27 +4,26 @@
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;; 1) setsid -f "$TERMINAL" -e pulsemixer ;;
2) pamixer -t ;; 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
4) pamixer --allow-boost -i 1 ;; 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ ;;
5) pamixer --allow-boost -d 1 ;; 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute. - Middle click to mute.
- Scroll to change." ;; - Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
[ $(pamixer --get-mute) = true ] && echo 🔇 && exit #echoing mute doenst work yet need help here
[ $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep 'MUTED') = true ] && echo 🔇 && exit
vol="$(pamixer --get-volume)" vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -d ':' -f 2)"
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
icon="🔊" icon="🔊"
elif [ "$vol" -gt "30" ]; then elif [ "$vol" -lt "30" ]; then
icon="🔉"
elif [ "$vol" -gt "0" ]; then
icon="🔈" icon="🔈"
else else
echo 🔇 && exit icon="🔉"
fi fi
echo "$icon$vol%" echo "$icon$vol%"