docs: Start automatically with Systemd
I found the systemd user service works wonderfully, with the only exception that even after adding the required pre-requsite units, `noisetorch -i ...` returns exit code `0` without actually loading the filters.
I found that adding a small sleep improves the reliability of the unit file and allows everything to start running smoothly.
I propose the unit file in the Wiki gets amended with the addition of `ExecStartPre=/bin/sleep 5`, to:
```py
[Unit]
Description=Noisetorch Noise Cancelling
Requires=$DEVICEUNIT
After=$DEVICEUNIT
# Depending on if you're using pulseaudio or pipewire, uncomment the correct line
# After=pulseaudio.service
# After=pipewire.service
[Service]
Type=simple
RemainAfterExit=yes
ExecStartPre=/bin/sleep 5
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
```
关闭于 2025-05-01 5 条评论