diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-09-02 19:07:00 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-09-02 19:07:00 +0400 |
commit | a0a334da9e6fa95adbd2946eb9ff01cb395bb16a (patch) | |
tree | d3fe6e06dccdead7e85a9d2384e9a27151b41574 | |
parent | e52a4f96180eb23f234009142d2270536288d642 (diff) |
svol: show less verbose volume percentage
-rwxr-xr-x | scripts/svol | 3 |
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 |