scripts/dwm/volume.sh
2022-12-28 16:44:03 -05:00

28 lines
559 B
Bash
Executable file

#!/bin/sh
case $BLOCK_BUTTON in
1) /home/swebb/Scripts/dwm/volumeMenu.sh;;
3) /home/swebb/Scripts/dwm/uvolume.sh toggle;;
esac
mute=$(amixer get Master | sed -n 5p | sed -E 's/.*\[//;s/\]//')
volume=$(amixer get Master | sed -n 5p | sed -E 's/[^\[]*\[//;s/\].*//')
head=$(amixer | grep -m 1 'Front Right:' | sed -E 's/.+\[/[/')
icon=""
case $mute in
on)
mute="^c#bbbbbb^"
if [ $head == "[off]" ]; then
icon=""
fi
;;
off)
mute="^c#F75341^"
if [ $head == "[off]" ]; then
icon=""
fi
;;
esac
echo "${mute}${icon} ${volume}"