Skip to content

Instantly share code, notes, and snippets.

@luisnquin
Created April 7, 2023 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisnquin/ec6d404976c638936bf4824ebd5e4799 to your computer and use it in GitHub Desktop.
Save luisnquin/ec6d404976c638936bf4824ebd5e4799 to your computer and use it in GitHub Desktop.
Little script to mute/unmute global microphone using amixer and notify-send
microphone_state=''
if [[ $(output=$(amixer set Capture toggle); echo "$output" | grep -m 1 --fixed-strings --only-matching '[on]') ]]; then
microphone_state=unmuted;
else
microphone_state=muted; fi
notify-send "Global microphone state: $microphone_state" "Triggered by keybinding (Ctrl + Alt + M)" --app-name=System --expire-time=2500 --urgency=normal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment