summaryrefslogtreecommitdiffstats
path: root/toggle-pulseaudio-mic-mute
diff options
context:
space:
mode:
Diffstat (limited to 'toggle-pulseaudio-mic-mute')
-rwxr-xr-xtoggle-pulseaudio-mic-mute5
1 files changed, 5 insertions, 0 deletions
diff --git a/toggle-pulseaudio-mic-mute b/toggle-pulseaudio-mic-mute
new file mode 100755
index 0000000..92efec0
--- /dev/null
+++ b/toggle-pulseaudio-mic-mute
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+target_value=$(if [[ $(pactl get-source-mute '@DEFAULT_SOURCE@' | sed 's/Mute: //') == "yes" ]]; then echo "no"; else echo "yes"; fi)
+
+pacmd list-sources | grep -oP 'index: \d+' | awk '{ print $2 }' | xargs -I{} pactl set-source-mute {} "$target_value"