Created
April 12, 2020 21:33
-
-
Save lawrencegripper/12216b1f77c06dfaa981b4a555fb6008 to your computer and use it in GitHub Desktop.
Mute and unmute mic Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pacmd list-sources | \ | |
grep -oP 'index: \d+' | \ | |
awk '{ print $2 }' | \ | |
xargs -I{} pactl set-source-mute {} toggle | |
MUTED=$(pacmd list-sources | grep "muted: no" | wc -l) | |
if (( $MUTED > 0 )); then | |
zenity --info --timeout=1 --title="Microphone" --text="Mic OFF" --width 600 --height 600 | |
else | |
zenity --info --timeout=1 --title="Microphone" --text="Mic ON" --width 600 --height 600 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment