aboutsummaryrefslogtreecommitdiff
path: root/vol.sh
blob: b40f380cca3ffe9b70b44a3d7c64c31e9207b37f (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" | grep -Eo '[0-9]+')"

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

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