добавляет статью про noisetorch
This commit is contained in:
parent
e70996d85b
commit
dc84ee1beb
53
notes/noisetorch-autostart/index.md
Normal file
53
notes/noisetorch-autostart/index.md
Normal file
@ -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
|
||||
```
|
Reference in New Issue
Block a user