summaryrefslogtreecommitdiff
path: root/.scripts
diff options
context:
space:
mode:
Diffstat (limited to '.scripts')
-rwxr-xr-x.scripts/toggle_mute.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/.scripts/toggle_mute.sh b/.scripts/toggle_mute.sh
new file mode 100755
index 0000000..0d6edd1
--- /dev/null
+++ b/.scripts/toggle_mute.sh
@@ -0,0 +1,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 $?