feat: Add systemd user service for automatic daemon startup and update installation instructions.
This commit is contained in:
@@ -40,6 +40,7 @@ The script will:
|
||||
1. Publish the project as a **Native AOT** Release binary.
|
||||
2. Install the executable to `/usr/bin/toak`.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ Toak/
|
||||
├── Serialization/
|
||||
│ └── AppJsonSerializerContext.cs # System.Text.Json source generation context for AOT support
|
||||
├── docs/ # Documentation
|
||||
├── toak.service # systemd user service file to run the daemon automatically
|
||||
└── Program.cs # Application entry point using System.CommandLine
|
||||
```
|
||||
|
||||
|
||||
@@ -14,5 +14,12 @@ if [ -d "/usr/share/zsh/site-functions" ]; then
|
||||
sudo cp _toak /usr/share/zsh/site-functions/_toak
|
||||
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 "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
12
toak.service
Normal 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
|
||||
Reference in New Issue
Block a user