diff --git a/notes/noisetorch-autostart/index.md b/notes/noisetorch-autostart/index.md new file mode 100644 index 0000000..27a4cae --- /dev/null +++ b/notes/noisetorch-autostart/index.md @@ -0,0 +1,53 @@ +--- +title: Автоматический старт Noisetorch +--- + +Оригинальное руководство: [ссылка](https://github.com/noisetorch/NoiseTorch/wiki/Start-automatically-with-Systemd) + +## Находим DEVICEUNIT и DEVICEID + +Находим `UNIT` устройства. + +```bash +systemctl list-units --type=device +``` + +Находим `Device ID` + +```bash +noisetorch -l +``` + +## Создаем Systemd Unit + +Создаем файл `~/.config/systemd/user/noisetorch.service` c таким содержимым: + +```toml +[Unit] +Description=Noisetorch Noise Cancelling +Requires=$DEVICEUNIT +After=$DEVICEUNIT +# Раскомментируйте нужное +# After=pulseaudio.service +# After=pipewire.service + +[Service] +Type=simple +RemainAfterExit=yes +ExecStart=%h/.local/bin/noisetorch -i -s $DEVICEID -t 95 +ExecStop=%h/.local/bin/noisetorch -u +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=default.target +``` + +Заменяем `$DEVICEUNIT` и `$DEVICEID`. + +Затем выполняем: + +```bash +systemctl --user daemon-reload +systemctl --user start noisetorch && systemctl --user enable noisetorch +``` \ No newline at end of file