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

@@ -0,0 +1,19 @@
#!/bin/sh
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
## 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"