volume module switched to alsa

This commit is contained in:
Luke Smith 2019-11-23 23:37:40 -05:00
parent 24325dd124
commit 09632e19ce
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -1,18 +1,20 @@
#!/usr/bin/env sh #!/usr/bin/env sh
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e pulsemixer & ;; 1) setsid "$TERMINAL" -e alsamixer & ;;
2) pulsemixer --toggle-mute ;; 2) amixer sset Master toggle ;;
4) pulsemixer --change-volume +5 ;; 4) amixer sset Master 5%+ ;;
5) pulsemixer --change-volume -5 ;; 5) amixer sset Master 5%- ;;
3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. 3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute. - Middle click to mute.
- Scroll to change." - Scroll to change."
esac esac
[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit volstat="$(amixer get Master)"
vol=$(pulsemixer --get-volume | awk '{print $1}') echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit
vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed 's/[^0-9]*//g')
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
icon="🔊" icon="🔊"