summaryrefslogtreecommitdiffstats
path: root/toggle-pulseaudio-mic-mute
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2024-07-02 12:58:04 +0200
committerFlorian Pritz <bluewind@xinu.at>2024-07-02 12:59:23 +0200
commite65064903d069256a7d80fed26c83435795cf6e0 (patch)
treecb8a91bbc01896cbba17da8f5895f3026bb07b97 /toggle-pulseaudio-mic-mute
parent8fddd2b490b2caff502571fb7c4159b97fd5705e (diff)
downloadbin-e65064903d069256a7d80fed26c83435795cf6e0.tar.gz
bin-e65064903d069256a7d80fed26c83435795cf6e0.tar.xz
add toggle-pulseaudio-mic-mute
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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"