dwmblocks/dwmblocks_scripts/dwm_volume

20 lines
424 B
Plaintext
Raw Normal View History

2022-11-09 20:00:41 +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
2022-11-09 20:24:40 +01:00
echo " 🔊 $vol%"
2022-11-09 20:00:41 +01:00
exit
fi
2022-11-09 20:24:40 +01:00
echo " 🔇 $vol%"
2022-11-09 20:00:41 +01:00
exit
fi
## just returns volume %
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -e "$vol"