summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2025-08-01 09:33:33 +0500
committerAnton Bobov <anton@bobov.name>2025-08-01 09:33:33 +0500
commita6ce11d6269b40fd328abd9c2ccde9baf45059a9 (patch)
tree6e74c184ddce02eddde1678cf08276f5ed2cf724
parent28787c7659b3a5b9cf9cfb2fa6b1563a168bdbc8 (diff)
Script to toggle noisetorch virtual mic
-rwxr-xr-xmic-toggle20
1 files changed, 20 insertions, 0 deletions
diff --git a/mic-toggle b/mic-toggle
new file mode 100755
index 0000000..f21ba3e
--- /dev/null
+++ b/mic-toggle
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+JACK_SOURCE=alsa_input.pci-0000_07_00.6.HiFi__hw_Generic_1__source
+
+get_noise_torch_device_name() {
+ pactl list sources short | grep NoiseTorch | awk -F '\t' '{print $2}' || return 0
+}
+
+main() {
+ if [ -z "$(get_noise_torch_device_name)" ]; then
+ noisetorch -i "$JACK_SOURCE"
+ pactl set-default-source "$(get_noise_torch_device_name)"
+ else
+ noisetorch -u
+ fi
+}
+
+main