1 #!/bin/bash 2 3 # amount=$(echo "$1" | cut -d " " -f 2) 4 # send_notification() { 5 # dunstify -r 13123 -h "int:value:$1" "$2 Volume ($1%)" -t 2000 6 # dunstify -r 13123 "$2 Volume $1%" -t 1750 7 # } 8 9 get_icon() { 10 if [ "$curr" -gt "50" ]; then 11 icon="🔊" 12 elif [ "$curr" -eq "0" ]; then 13 icon="🔇" 14 elif [ "$curr" -lt "25" ]; then 15 icon="🔈" 16 else 17 icon="🔉" 18 fi 19 } 20 21 pactl set-sink-mute @DEFAULT_SINK@ toggle; 22 23 if [ "$(pamixer --get-mute)" == "false" ]; then 24 curr=$(pamixer --get-volume) 25 get_icon $icon 26 # send_notification $curr $icon 27 fi 28 # else 29 # send_notification "0" "🔇" 30 # fi 31 32 kill -35 $(pidof dwmblocks) 33 34 # min=$((0 + $amount)) 35 # max=$((100 - $amount)) 36 37 # (($curr<=$max)) && $(pactl set-sink-volume @DEFAULT_SINK@ +$amount%) 38 39 # [ $curr -ne $min ] && [ $curr -ne $max ] && curr=$(($curr + $amount)) 40 41 # send_notification $curr $icon
