Skip to content

Instantly share code, notes, and snippets.



Last active Jan 19, 2021
What would you like to do?
Push to talk microphone with Pulseaudio

Microphone PTT for Pulseaudio

This tool helps you with many absolutely proprietary software which doesn't include proper push-to-talk key. I wrote this with Google Meet in mind but is also useful for many other browser based apps as well.

Like this? Support me at Github!


First, install requirements and symlink the configuration file.

sudo apt install xbindkeys
ln -s `readlink -f xbindkeysrc` ~/.xbindkeysrc

If you already have xbindkeys setup, just concatenate the contents to your main config.

Then make xbindkeys to autostart on login:

mkdir -p ~/.config/autostart-scripts/
ln -s /usr/bin/xbindkeys ~/.config/autostart-scripts


Edit attached xbindkeysrc file to match your needs:

PTT button

Default: Caps lock

Change c:66 to the key name you want to use as PTT key. To get name of your key, run:

xbindkeys -k -f /dev/null


If you want to control a specific mic instead of default one, replace @DEFAULT_SOURCE@ with Pulseaudio sink name. To get list input device names, run:

pactl list short sources | cut -f 2
# -*- shell-script -*-
# To use this, make xbindkeys start on login and symlink this file to
# ~/.xbindkeysrc
"pactl set-source-mute @DEFAULT_SOURCE@ 0"
"pactl set-source-mute @DEFAULT_SOURCE@ 1"

This comment has been minimized.

Copy link

@fmayer fmayer commented Mar 20, 2020

I had to add xset -r 66; before both of the commands in xbindkeysrc, to prevent it from toggling on and off very high frequency making it

"xset -r 66; pactl set-source-mute @DEFAULT_SOURCE@ 0"

"xset -r 66; pactl set-source-mute @DEFAULT_SOURCE@ 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment