summaryrefslogtreecommitdiff
path: root/.scripts/toggle_mute.sh
blob: 0d6edd14cf9640e209bb82effa72a92bf4a5a397 (plain)
1
2
3
4
5
6
7
8
9
10
11
dev="alsa_output.pci-0000_00_1b.0.analog-stereo"
tp=ink

if [[ "x$1" = "xinput" ]]; then
	dev="alsa_input.pci-0000_00_1b.0.analog-stereo"
	tp=ource
fi

LC_ALL=C pactl list | \
	sed -n -e:a -eN -e"/^S$tp.*Name: $dev.*Mute: no/q1" -e'/\n$/d' -eba
pactl "set-s$tp-mute" $dev $?