scripts: fix get volume script

This commit is contained in:
Dmitriy Pleshevskiy 2022-07-20 15:08:50 +03:00
parent 0850b4fd02
commit f3fae543a7
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -1,9 +1,8 @@
#!/bin/bash
res=$(amixer -D pulse sget Master)
enabled=$(echo $res | egrep -o "\[on\]" | wc -l)
enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l)
if [[ $enabled == "0" ]]; then
echo "off"
else
echo $(echo $res | egrep -o "[0-9]+%" | head -n 1)
echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1)
fi
exit 0