From a0a334da9e6fa95adbd2946eb9ff01cb395bb16a Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Mon, 2 Sep 2024 19:07:00 +0400 Subject: svol: show less verbose volume percentage --- scripts/svol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/svol b/scripts/svol index 79251a2..18287fa 100755 --- a/scripts/svol +++ b/scripts/svol @@ -57,7 +57,8 @@ while getopts "i:d:s:pth" option; do "${0}: Failed to toggle volume" ;; p) - if ! pactl get-sink-volume @DEFAULT_SINK@ 2>/dev/null; then + if ! pactl list sinks | grep '^[[:space:]]Volume:' | \ + head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' 2>/dev/null; then err "Failed to get current volume" else exit 0 -- cgit v1.2.3