Skip to content

Instantly share code, notes, and snippets.

@n-st
Created April 27, 2020 18:18
Show Gist options
  • Save n-st/1eed75eaa2d53fd8430f98a228390925 to your computer and use it in GitHub Desktop.
Save n-st/1eed75eaa2d53fd8430f98a228390925 to your computer and use it in GitHub Desktop.
Keyboard shortcut to mute/unmute default microphone (or other default audio source)
#!/bin/sh
notify-send \
--expire-time=700 \
"$(pacmd list-sources | awk 'BEGIN { FPAT = "[^ \t]+|\"[^\"]+\"" } $1 == "*" { find=1 } $1 == "device.description" { if (find) { print substr($NF,2,length($NF)-2); exit; } }')" \
"→ $(amixer set Capture toggle | grep -oP '(?<=\[)o[nf]+(?=\])' | sort -u)"
"microphone-toggle"
shift + XF86AudioMute
"microphone-toggle"
XF86AudioMicMute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment