diff --git a/bin/set-vol b/bin/set-vol index 85a9e61..49b9970 100755 --- a/bin/set-vol +++ b/bin/set-vol @@ -1,5 +1,8 @@ #!/bin/bash -e +DUNSTIFY='dunstify -t 1000 -a changeVolume -u low' +DUNSTIFYVOL="$DUNSTIFY -i audio-volume-high" + SINK='@DEFAULT_AUDIO_SINK@' WPCUR="$(wpctl get-volume "$SINK")" CUR="$((10#$(tr -dc '0-9' <<< "$WPCUR")))" @@ -9,10 +12,10 @@ grep -q MUTED <<< "$WPCUR" && MUTE=1 || MUTE=0 if [ "$1" == 'm' ]; then if [ "$MUTE" = 1 ]; then wpctl set-mute "$SINK" 0 - dunstify -a 'changeVolume' -u low -i audio-volume-high -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" + $DUNSTIFYVOL -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" else wpctl set-mute "$SINK" 1 - dunstify -a "changeVolume" -u low -i audio-volume-muted -h string:x-dunst-stack-tag:vol "Mute" + $DUNSTIFY -i audio-volume-muted -h string:x-dunst-stack-tag:vol "Mute" fi else case "${1:0:1}" in @@ -25,7 +28,7 @@ else if [ "$MUTE" = 1 ]; then wpctl set-mute "$SINK" 0 fi - dunstify -a 'changeVolume' -u low -i audio-volume-high -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" + $DUNSTIFYVOL -h string:x-dunst-stack-tag:vol -h int:value:"$CUR" "$CUR%" fi # update sbar