add toggle-mic-mute.sh script

also, adjust dunst config for it
This commit is contained in:
2022-06-12 00:38:54 +03:00
parent 49c359e2d2
commit c3725494c6
3 changed files with 24 additions and 3 deletions

17
bin/toggle-mic-mute.sh Executable file
View File

@@ -0,0 +1,17 @@
#! /bin/bash
pactl list sources | grep -qi 'Mute: yes'
state="$?"
id="991050"
appName="microphone-is-muted"
if [[ "$state" == "0" ]]; then
# mic is muted
pactl set-source-mute @DEFAULT_SOURCE@ 0
dunstify -a "$appName" -u low -t 1000 -r "$id" "Actived microphone" "It's not muted now"
else
# mic is not muted
pactl set-source-mute @DEFAULT_SOURCE@ 1
dunstify -a "$appName" -u low -t 1000 -r "$id" "Disabled microphone" "It's muted now"
fi