make getvol script nicer and work without amixer

This commit is contained in:
elkowar 2023-07-29 21:14:09 +02:00
parent 27830a8c6d
commit a470bb816f
No known key found for this signature in database
GPG key ID: 50E76B4711E4C3E4

View file

@ -1,2 +1,7 @@
#!/bin/sh
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1
if command -v pactl &>/dev/null; then
pactl get-sink-volume $(pactl get-default-sink) | awk -F '[^0-9]+' '/left:/{print $3}'
else
amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}'
fi