This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
content/notes/noisetorch-autostart/index.md

53 lines
1.1 KiB
Markdown

---
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
```