Last active
May 24, 2023 11:58
-
-
Save eric-glb/f6bfcc592e4fb4ddbcf3ba64cb20687d to your computer and use it in GitHub Desktop.
Linux: short script to mute/unmute mic (to associate to a keyboard shortcut)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Short script to mute/unmute mic; to associate to a keyboard shortcut | |
icon="audio-input-microphone-symbolic" | |
state=$(amixer set Capture toggle | awk 'match($0, /Front Left.*\[(.*)\]/, a) {print a[1]}') | |
# On Debian/Ubuntu/...: apt-get install libnotify-bin | |
which notify-send &>/dev/null && notify-send --hint=int:transient:1 -i $icon "Mic switched: $state" | |
echo -e "\nMic switched: $state\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment