summaryrefslogtreecommitdiff
path: root/.local/bin/audio_mutemic
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/audio_mutemic')
-rwxr-xr-x.local/bin/audio_mutemic15
1 files changed, 15 insertions, 0 deletions
diff --git a/.local/bin/audio_mutemic b/.local/bin/audio_mutemic
new file mode 100755
index 0000000..1a2f01a
--- /dev/null
+++ b/.local/bin/audio_mutemic
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+# toggle mic mute and send notification about current state
+
+wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
+
+command -v notify-send > /dev/null || exit
+case "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" in
+*\[MUTED\])
+ notify-send " muted" "microphone is muted"
+ ;;
+*)
+ notify-send " unmuted" "microphone is unmuted"
+ ;;
+esac