From 928a724d8aafce4774bfb76f462e3b72c7906459 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 14 Oct 2024 21:39:52 +0200 Subject: toggle-pulseaudio-mic-mute: Show notification for instant feedback Signed-off-by: Florian Pritz --- toggle-pulseaudio-mic-mute | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'toggle-pulseaudio-mic-mute') 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" -- cgit v1.2.3-24-g4f1b