From a6ce11d6269b40fd328abd9c2ccde9baf45059a9 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Fri, 1 Aug 2025 09:33:33 +0500 Subject: Script to toggle noisetorch virtual mic --- mic-toggle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 mic-toggle 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 -- cgit v1.2.3