Here's a tool I put together this evening.

**The Problem**
Sometimes I'm on a call and need to unmute my mic quickly. There's a keystroke for this (by default Alt-A), but this only works if Zoom has focus. It's not uncommon for me to have switched to the PDF or email we're discussing, so I have to dig up Zoom before I can unmute and chime in, often missing the conversational opportunity.

**The Solution**
I wrote a script that:
1. checks if any audio streams are going into Zoom, otherwise quits
2. finds the numerical ID of the audio stream going into Zoom
3. toggles the mute flag on said audio stream

I bound it to the keystroke Control-Alt-A in my desktop environment, so I can easily toggle the mute no matter what application has focus.

**The Dependencies**
This is written in for systems using and depends on its control tool `pactl` being installed.

**The Code**
```
#!/bin/bash
```
```
PASOPS=$(pactl list source-outputs)
```
```
if echo "$PASOPS" | grep -q 'ZOOM VoiceEngine' ; then
```
```
SOPID=$(echo "$PASOPS" | head -n $(($(echo "$PASOPS" | grep -n -e 'application.name = "ZOOM VoiceEngine"' | cut -f1 -d:) - 1)) - | grep -o -e 'Source Output #[0-9]\+' | grep -o -e '[0-9]\+' | tail -n 1);
```
```
pactl set-source-output-mute $SOPID toggle; fi
```

Follow

@khird
Wouldn't it be easier to just plug in a mic with a switch? You're running zoom on linux?

@Diptchip I'm using a Bluetooth headset, which has controls for the sink audio (played through earpieces) but not the source (recorded from mic). I could maybe crack it open and solder a switch in series with the mic; but, no, that wouldn't be easier.

Yes I run Zoom on Linux - Linux has been my daily driver for about ten years, and I don't get to dictate what communications tool we use.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.