1
0

feat: Add systemd user service for automatic daemon startup and update installation instructions.

This commit is contained in:
2026-02-28 12:49:15 +01:00
parent 27d7d11b63
commit 6d2ad488d2
4 changed files with 21 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ The script will:
1. Publish the project as a **Native AOT** Release binary. 1. Publish the project as a **Native AOT** Release binary.
2. Install the executable to `/usr/bin/toak`. 2. Install the executable to `/usr/bin/toak`.
3. Install **Zsh completions** to `/usr/share/zsh/site-functions/`. 3. Install **Zsh completions** to `/usr/share/zsh/site-functions/`.
4. Install and enable the `toak.service` systemd user service so the background daemon runs automatically.
--- ---

View File

@@ -39,6 +39,7 @@ Toak/
├── Serialization/ ├── Serialization/
│ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support │ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support
├── docs/ # Documentation ├── docs/ # Documentation
├── toak.service # systemd user service file to run the daemon automatically
└── Program.cs # Application entry point using System.CommandLine └── Program.cs # Application entry point using System.CommandLine
``` ```

View File

@@ -14,5 +14,12 @@ if [ -d "/usr/share/zsh/site-functions" ]; then
sudo cp _toak /usr/share/zsh/site-functions/_toak sudo cp _toak /usr/share/zsh/site-functions/_toak
fi fi
echo "Installing and starting systemd user service..."
sudo mkdir -p ~/.config/systemd/user
sudo cp toak.service ~/.config/systemd/user/
sudo systemctl --user daemon-reload
sudo systemctl --user enable --now toak.service
echo "Installation complete! You can now run 'toak' from anywhere." echo "Installation complete! You can now run 'toak' from anywhere."
echo "Note: You may need to restart your zsh shell or run 'autoload -Uz compinit && compinit' to enable completions." echo "Note: You may need to restart your zsh shell or run 'autoload -Uz compinit && compinit' to enable completions."
echo "The Toak daemon is running in the background."

12
toak.service Normal file
View File

@@ -0,0 +1,12 @@
[Unit]
Description=Toak Dictation Daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/toak daemon
Restart=always
RestartSec=3
[Install]
WantedBy=default.target