summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2024-09-02 19:07:00 +0400
committerSuleyman Farajli <suleyman@farajli.net>2024-09-02 19:07:00 +0400
commita0a334da9e6fa95adbd2946eb9ff01cb395bb16a (patch)
treed3fe6e06dccdead7e85a9d2384e9a27151b41574
parente52a4f96180eb23f234009142d2270536288d642 (diff)
svol: show less verbose volume percentage
-rwxr-xr-xscripts/svol3
1 files changed, 2 insertions, 1 deletions
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