volume (587B)
1 #!/bin/sh 2 3 # Prints the current volume or 🔇 if muted. 4 5 case $BLOCK_BUTTON in 6 1) setsid -f "$TERMINAL" -e pulsemixer ;; 7 2) pamixer -t ;; 8 4) pamixer --allow-boost -i 1 ;; 9 5) pamixer --allow-boost -d 1 ;; 10 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. 11 - Middle click to mute. 12 - Scroll to change." ;; 13 6) "$TERMINAL" -e "$EDITOR" "$0" ;; 14 esac 15 16 [ $(pamixer --get-mute) = true ] && echo 🔇 && exit 17 18 vol="$(pamixer --get-volume)" 19 20 if [ "$vol" -gt "70" ]; then 21 icon="🔊" 22 elif [ "$vol" -lt "30" ]; then 23 icon="🔈" 24 else 25 icon="🔉" 26 fi 27 28 echo "$icon$vol%"