summaryrefslogtreecommitdiffstats
path: root/toggle-pulseaudio-mic-mute
diff options
context:
space:
mode:
Diffstat (limited to 'toggle-pulseaudio-mic-mute')
-rwxr-xr-xtoggle-pulseaudio-mic-mute10
1 files changed, 10 insertions, 0 deletions
diff --git a/toggle-pulseaudio-mic-mute b/toggle-pulseaudio-mic-mute
index 92efec0..d96b599 100755
--- a/toggle-pulseaudio-mic-mute
+++ b/toggle-pulseaudio-mic-mute
@@ -3,3 +3,13 @@
target_value=$(if [[ $(pactl get-source-mute '@DEFAULT_SOURCE@' | sed 's/Mute: //') == "yes" ]]; then echo "no"; else echo "yes"; fi)
pacmd list-sources | grep -oP 'index: \d+' | awk '{ print $2 }' | xargs -I{} pactl set-source-mute {} "$target_value"
+
+
+notify_opts=()
+if [[ "$target_value" = "yes" ]]; then
+ notify_opts=(-h "string:bgcolor:#ff0000" -h "string:fgcolor:#000000")
+else
+ notify_opts=(-h "string:bgcolor:#00ff00" -h "string:fgcolor:#000000")
+fi
+
+notify-send "${notify_opts[@]}" -h string:x-canonical-private-synchronous:"${0##*/}" -t 3000 "Microphone mute: $target_value"