The goal of this script was to have a simple script, binded with a shortcut which allows to mute/unmute all the microphones and to display a nice notification in the process. This is the simplest version working on xubuntu 14.04 with pulseaudio.
<pre lang="bash">#!/bin/bash
ACTION=1 #1 mute, 0 unmute
SCNT=$(pacmd list-sources | grep muted | wc -l)
MUTED=$(pacmd list-sources | grep muted | grep yes)
if [ $? == 0 ]; then
ACTION=0
notify-send -i microphone-sensitivity-medium "Microphone" "Unmutting $SCNT sources..."
else
notify-send -i microphone-sensitivity-muted "Microphone" "Mutting $SCNT sources..."
fi
#SRC=$(seq $SCNT)
SRC=$(pacmd list-sources | grep index | cut -d':' -f2 | tr -d ' ')
for i in $SRC; do
#let s=$i-1
pacmd set-source-mute $i $ACTION
done