1 #!/bin/bash 2 3 # amount=$(echo "$1" | cut -d " " -f 2) 4 # amount=$2 5 6 send_notification() { 7 dunstify -r 13123 "$2 Volume $1%" -t 1750 8 } 9 10 get_icon() { 11 if [ "$mute" == "true" ] | [ "$curr" -eq "0" ]; then 12 icon="🔇" 13 break; 14 elif [ "$curr" -gt "50" ]; then 15 icon="🔊" 16 elif [ "$curr" -lt "25" ]; then 17 icon="🔈" 18 else 19 icon="🔉" 20 fi 21 } 22 23 pamixer $1 $2 && kill -35 $(pidof dwmblocks) 24 25 curr=$(pamixer --get-volume) 26 mute=$(pamixer --get-mute) 27 28 get_icon 29 send_notification $curr $icon