volume module only uses default. old alsa rm'd
This commit is contained in:
parent
bb934de611
commit
efbc3f3de3
1 changed files with 4 additions and 14 deletions
|
@ -1,13 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Prints the current volume or 🔇 if muted. Uses PulseAudio by default,
|
# Prints the current volume or 🔇 if muted.
|
||||||
# uncomment the ALSA lines if you remove PulseAudio.
|
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
# 1) setsid -f "$TERMINAL" -e alsamixer ;;
|
|
||||||
# 2) amixer sset Master toggle ;;
|
|
||||||
# 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
|
|
||||||
# 5) amixer sset Master 5%- >/dev/null 2>/dev/null ;;
|
|
||||||
1) setsid -f "$TERMINAL" -e pulsemixer ;;
|
1) setsid -f "$TERMINAL" -e pulsemixer ;;
|
||||||
2) pamixer -t ;;
|
2) pamixer -t ;;
|
||||||
4) pamixer --allow-boost -i 1 ;;
|
4) pamixer --allow-boost -i 1 ;;
|
||||||
|
@ -18,14 +13,9 @@ case $BLOCK_BUTTON in
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
volstat="$(pactl list sinks)"
|
[ $(pamixer --get-mute) = true ] && echo 🔇 && exit
|
||||||
# volstat="$(amixer get Master)" # ALSA only equivalent.
|
|
||||||
|
|
||||||
echo "$volstat" | grep -q "Mute: yes" && printf "🔇\\n" && exit
|
vol="$(pamixer --get-volume)"
|
||||||
# echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit # ALSA
|
|
||||||
|
|
||||||
vol="$(echo "$volstat" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
|
|
||||||
# vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") # ALSA
|
|
||||||
|
|
||||||
if [ "$vol" -gt "70" ]; then
|
if [ "$vol" -gt "70" ]; then
|
||||||
icon="🔊"
|
icon="🔊"
|
||||||
|
@ -35,4 +25,4 @@ else
|
||||||
icon="🔉"
|
icon="🔉"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%s%s%%\\n" "$icon" "$vol"
|
echo "$icon$vol%"
|
||||||
|
|
Loading…
Reference in a new issue