2020-02-08 23:43:37 +00:00
|
|
|
#!/bin/sh
|
2019-11-23 21:23:24 +00:00
|
|
|
|
2020-06-14 23:13:13 +00:00
|
|
|
# Prints the current volume or 🔇 if muted.
|
2020-04-09 21:03:51 +00:00
|
|
|
|
2019-11-23 21:23:24 +00:00
|
|
|
case $BLOCK_BUTTON in
|
2020-05-30 21:01:18 +00:00
|
|
|
1) setsid -f "$TERMINAL" -e pulsemixer ;;
|
2020-04-15 00:37:22 +00:00
|
|
|
2) pamixer -t ;;
|
|
|
|
4) pamixer --allow-boost -i 1 ;;
|
|
|
|
5) pamixer --allow-boost -d 1 ;;
|
2020-04-09 02:01:51 +00:00
|
|
|
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
|
2019-11-23 21:23:24 +00:00
|
|
|
- Middle click to mute.
|
2020-05-07 21:31:42 +00:00
|
|
|
- Scroll to change." ;;
|
|
|
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
2019-11-23 21:23:24 +00:00
|
|
|
esac
|
|
|
|
|
2020-06-14 23:13:13 +00:00
|
|
|
[ $(pamixer --get-mute) = true ] && echo 🔇 && exit
|
2019-11-23 21:23:24 +00:00
|
|
|
|
2020-06-14 23:13:13 +00:00
|
|
|
vol="$(pamixer --get-volume)"
|
2019-11-23 21:23:24 +00:00
|
|
|
|
|
|
|
if [ "$vol" -gt "70" ]; then
|
|
|
|
icon="🔊"
|
|
|
|
elif [ "$vol" -lt "30" ]; then
|
|
|
|
icon="🔈"
|
|
|
|
else
|
|
|
|
icon="🔉"
|
|
|
|
fi
|
|
|
|
|
2020-06-14 23:13:13 +00:00
|
|
|
echo "$icon$vol%"
|