Skip to content

Instantly share code, notes, and snippets.

@JosephCastro
Created August 6, 2021 16:10
Show Gist options
  • Save JosephCastro/77f6da98e139fde77a8d8f4b6993272d to your computer and use it in GitHub Desktop.
Save JosephCastro/77f6da98e139fde77a8d8f4b6993272d to your computer and use it in GitHub Desktop.
#! /bin/sh
# With icon indicating the state of the mic
state=`amixer set Capture toggle | gawk 'match($0, /Front Left.*\[(.*)\]/, a) {print a[1]}'`
if [ $state = "off" ]; then
icon="audio-input-microphone-muted-symbolic"
else
icon="audio-input-microphone-symbolic"
fi
notify-send --hint=int:transient:1 -i $icon "Mic switched: $state"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment