aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/pvol.sh
blob: 8d5984ec2adf2658b583c4b1757e2a570ff2fa6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env zsh

case "$1" in
	down)
		pactl set-sink-volume @DEFAULT_SINK@ -2%
		;;
	up)
		pactl set-sink-volume @DEFAULT_SINK@ +2%
		;;
	mute)
		pactl set-sink-mute @DEFAULT_SINK@ toggle
		;;
esac

{
	[[ $(pactl get-sink-mute @DEFAULT_SINK@) =~ "yes" ]] && printf "Muted: " || printf "Volume: "

	pactl get-sink-volume @DEFAULT_SINK@ | sed -e N -e 's/\n//g' -e 's/.* \([0-9]\{1,2\}%\).*/\1/'
} | read body

dunstify -r 118111108 $body