dwmblocks/dwmblocks_scripts/dwm_volume_amixer.old

20 lines
418 B
Plaintext
Raw Normal View History

2022-12-12 15:59:27 +01:00
#!/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"