diff options
| author | Anton Bobov <anton@bobov.name> | 2025-08-01 09:33:33 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2025-08-01 09:33:33 +0500 |
| commit | a6ce11d6269b40fd328abd9c2ccde9baf45059a9 (patch) | |
| tree | 6e74c184ddce02eddde1678cf08276f5ed2cf724 | |
| parent | 28787c7659b3a5b9cf9cfb2fa6b1563a168bdbc8 (diff) | |
Script to toggle noisetorch virtual mic
| -rwxr-xr-x | mic-toggle | 20 |
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 |
