aboutsummaryrefslogtreecommitdiff
path: root/vol.sh
blob: 6b8081fdad2895aefc71d9109e7f930cd06eac75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

sink="@DEFAULT_SINK@"

if [ "$1" = "mute" ]; then
	pactl set-sink-mute "$sink" toggle
else
	pactl set-sink-volume "$sink" "$1%"
fi

text="$(~/scripts/i3blocks/i3vol.sh)"
vol="$(echo "$text" | cut -d' ' -f2-)"

dunstify -r "$(dunstifyIDs.sh "vol")" \
	-t 500 \
	-h "int:value:${vol}" \
	"$text"

[ -n "$STATUS_BAR" ] && pkill -SIGRTMIN+10 "$STATUS_BAR"