This commit is contained in:
2022-12-12 15:59:27 +01:00
parent 66945b37e4
commit d15f3ea237
5 changed files with 28 additions and 23 deletions

View File

@ -1,19 +1,5 @@
#!/bin/sh
#!/bin/bash
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
vol="$(pamixer --get-volume-human)"
echo "VOL $vol"
## if any argument
if [ $# -gt 0 ]; then
stat="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)].*/\1/')"
if [[ $(echo $stat) == "on" ]]; then
echo "VOL $vol%"
exit
fi
echo "MUT $vol%"
exit
fi
## just returns volume %
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -e "$vol"