diff options
author | Florian Pritz <bluewind@xinu.at> | 2024-10-14 21:39:52 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2024-10-14 21:54:03 +0200 |
commit | 928a724d8aafce4774bfb76f462e3b72c7906459 (patch) | |
tree | f976dea5f990cafea7d8023c1605d84e3b28ae98 /toggle-pulseaudio-mic-mute | |
parent | ffcd3c75d9a5013a8b59d16f0fcf928e42e8a906 (diff) | |
download | bin-928a724d8aafce4774bfb76f462e3b72c7906459.tar.gz bin-928a724d8aafce4774bfb76f462e3b72c7906459.tar.xz |
toggle-pulseaudio-mic-mute: Show notification for instant feedback
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'toggle-pulseaudio-mic-mute')
-rwxr-xr-x | toggle-pulseaudio-mic-mute | 10 |
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" |