From 44fa18367edbc06ca0144185f954a05bd07355d7 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:45:45 +0200 Subject: [PATCH] make getvol use pamixer --- examples/eww-bar/scripts/getvol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/eww-bar/scripts/getvol b/examples/eww-bar/scripts/getvol index 5b92a39..4e4275d 100755 --- a/examples/eww-bar/scripts/getvol +++ b/examples/eww-bar/scripts/getvol @@ -1,7 +1,12 @@ #!/bin/sh -if command -v pactl &>/dev/null; then - pactl get-sink-volume $(pactl get-default-sink) | awk -F '[^0-9]+' '/left:/{print $3}' +if command -v pamixer &>/dev/null; then + if [ true == $(pamixer --get-mute) ]; then + echo 0 + exit + else + pamixer --get-volume + fi else amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}' fi