my dwmblocks setup

This commit is contained in:
2022-11-09 20:00:41 +01:00
parent a933ce0d61
commit 1528bb5fc9
6 changed files with 70 additions and 4 deletions

19
dwmblocks_scripts/dwm_volume Executable file
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"
exit
fi
echo " 🔇 $vol"
exit
fi
## just returns volume %
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo -e "$vol"