Skip to content

Instantly share code, notes, and snippets.

@enly1
Last active January 1, 2021 10:29
Show Gist options
  • Save enly1/cbfc3b3c3ccb2fc5c9e3281d91100d1c to your computer and use it in GitHub Desktop.
Save enly1/cbfc3b3c3ccb2fc5c9e3281d91100d1c to your computer and use it in GitHub Desktop.
Script to mute/un-mute default capture device
#!/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