Skip to content

Instantly share code, notes, and snippets.

@fullmetal1
fullmetal1 / README.md
Last active November 4, 2021 02:07
A bash script to get system-wide push to talk through mouse/keyboard buttons on any Linux, BSD, Unix etc system running Xorg and pulseaudio

I couldn't find a single example of one of these online so I decided to do it myself and share it for the world's convenience.

This script requires a system with Xorg, pulseaudio, and xinput (not the Microsoft one). I have only ever tested on linux. You may need to modify some commands. Your usage may vary in which case you will have to modify this script. The functionality is slightly esoteric so I will describe the functionality here:

The script runs as a one liner bash command. This is done so that I can put it into XFCE's session and startup without creating a new script for it. First the script finds the id of the virtual core pointer (sum of all pointer devices) Then the script mutes the default source (hopefully your microphone). This is because pulseaudio tends to unmute sources on startup.