Last active
January 1, 2021 10:29
-
-
Save enly1/cbfc3b3c3ccb2fc5c9e3281d91100d1c to your computer and use it in GitHub Desktop.
Script to mute/un-mute default capture device
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
#!/bin/bash | |
pactl set-source-mute \@DEFAULT_SOURCE\@ toggle | |
amixer -D pulse | grep -E "Capture.*\[on\]" | |
if [ "$?" = "0" ]; then | |
icon="microphone-sensitivity-high" | |
notify-send -t 750 -i $icon "Micophone Un-muted" "Default microphone is now active" | |
else | |
icon="microphone-sensitivity-muted" | |
notify-send -t 750 -i $icon "Microphone Muted" "Default microphone is now muted" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment