Version: 1.2.0
Service Tray is a lightweight tray application for Linux that allows you to monitor and control systemd services directly from your desktop. It shows a status icon (green/red) depending on whether services are active and provides a menu to toggle, refresh, or quit services.
- Tray Icon:
- Green if at least one service is running.
- Red if all services are stopped.
- Dynamic Menu:
- Lists services from a configuration file with port information.
- Shows service status, name, and port number.
- Hover over any service to reveal submenu with additional options.
- Service Management:
- Left-click on service: Toggle start/stop
- Hover on service: Shows submenu with Start/Stop and Enable/Disable options
- Automatic Updates:
- Icon and service status update every 5 seconds.
- Easy Autostart:
- Installs itself to start at user login.
- System-wide Access:
- Available as
service-traycommand from anywhere in terminal
- Available as
- Sudo Security:
- User types password only once per session when toggling services.
git clone https://github.com/lavrottweiler/Service-tray.git
cd Service-tray./install.shThis will:
- Install all necessary dependencies for Debian/Ubuntu, Arch/Manjaro, or Fedora.
- Make
service-tray.pyexecutable. - Copy default icons to the
iconsdirectory. - Create a system-wide command
service-tray. - Create an autostart entry so Service Tray launches at login.
- Launch Service Tray immediately.
The list of services is defined in services.conf in the project directory.
Format:
Display Name = systemd-service-name
Example:
ComfyUI = comfyui.service
Whisper = whisper.service
Forge = forgeui.service
Ollama = ollama.service
Service ports are defined in the application and displayed alongside each service.
- Lines starting with
#are ignored. - To add or remove services, edit this file and then click Refresh Services in the menu.
If you need to create a systemd service file for ForgeUI, follow these detailed steps:
-
Create the service file:
sudo nano /etc/systemd/system/forgeui.service
-
Add the following content (adapt paths and user as needed):
[Unit] Description=ForgeUI Service After=network.target [Service] Type=simple User=your-username WorkingDirectory=/path/to/forgeui ExecStart=/path/to/forgeui/venv/bin/python /path/to/forgeui/launch.py --listen --port 1234 Restart=always RestartSec=10 [Install] WantedBy=multi-user.targetImportant fields to customize:
User: Replace with your actual usernameWorkingDirectory: Path to your ForgeUI installation directoryExecStart: Full path to the Python executable and the command to start ForgeUIDescription: A description of your service
-
Save the file (Ctrl+X, then Y, then Enter in nano).
-
Reload systemd to recognize the new service:
sudo systemctl daemon-reload
-
Enable the service to start at boot:
sudo systemctl enable forgeui.service -
Start the service:
sudo systemctl start forgeui.service
-
Verify the service is running:
sudo systemctl status forgeui.service
-
Check service logs (if needed):
sudo journalctl -u forgeui.service -f
-
Test that your service works with Service Tray:
- Add
Forge = forgeui.serviceto yourservices.conffile - Click Refresh Services in the Service Tray menu
- You should now be able to manage the ForgeUI service from the tray
- Add
If you installed ComfyUI using comfy-cli, you need to create a systemd service file that works with the global comfy command. Follow these detailed steps:
-
Find the comfy command location:
First, determine where the
comfycommand is installed:which comfy
This will typically return something like
/home/your-username/.local/bin/comfyor/usr/local/bin/comfy -
Create the service file:
sudo nano /etc/systemd/system/comfyui.service
-
Add the following content (adapt paths and user as needed):
[Unit] Description=ComfyUI Application After=network.target [Service] Type=simple User=your-username Group=your-username WorkingDirectory=/path/to/your/ComfyUI/directory Environment="PATH=/usr/local/bin:/usr/bin:/bin:/home/your-username/.local/bin" ExecStart=/home/your-username/.local/bin/comfy launch -- --listen --port 8188 Restart=always RestartSec=10 StandardOutput=journal StandardError=journal [Install] WantedBy=default.targetImportant fields to customize:
UserandGroup: Replace with your actual usernameWorkingDirectory: Path to your ComfyUI installation directory (where comfy-cli installed it)Environment: Set the PATH to include where thecomfycommand is located (use the path from step 1)ExecStart: Full path to thecomfycommand with the launch subcommandDescription: A description of your service- Add any specific arguments after the
--in the ExecStart line (like --port, --listen, --cuda-device, etc.)
-
Alternative approach using a shell script:
If the direct command doesn't work properly, create a shell script first:
nano /home/your-username/start_comfyui.sh
Add this content:
#!/bin/bash export PATH="$PATH:/home/your-username/.local/bin:/usr/local/bin:/usr/bin:/bin" cd /path/to/your/ComfyUI/directory /home/your-username/.local/bin/comfy launch -- --listen --port 8188
Make it executable:
chmod +x /home/your-username/start_comfyui.sh
Then use this service file instead:
[Unit] Description=ComfyUI Application After=network.target [Service] Type=simple User=your-username Group=your-username WorkingDirectory=/path/to/your/ComfyUI/directory ExecStart=/home/your-username/start_comfyui.sh Restart=always RestartSec=10 StandardOutput=journal StandardError=journal [Install] WantedBy=default.target -
Save the file (Ctrl+X, then Y, then Enter in nano).
-
Reload systemd to recognize the new service:
sudo systemctl daemon-reload
-
Enable the service to start at boot:
sudo systemctl enable comfyui.service -
Start the service:
sudo systemctl start comfyui.service
-
Verify the service is running:
sudo systemctl status comfyui.service
-
Check service logs if there are issues:
sudo journalctl -u comfyui.service -f
-
Troubleshooting common issues:
If you get an exit code 203 (EXEC), this usually means systemd can't find the executable. Make sure:
- The path to the
comfycommand is correct - The PATH environment variable in the service includes the directory where
comfyis installed - The user specified has permission to access the executable
- The path to the
-
Test that your service works with Service Tray:
- Add
ComfyUI = comfyui.serviceto yourservices.conffile - Click Refresh Services in the Service Tray menu
- You should now be able to manage the ComfyUI service from the tray
- Add
- Toggle Service: Left-click a service in the menu to start/stop it.
- Service Submenu: Hover over any service to reveal additional options:
- Start/Stop - Toggle service state
- Enable/Disable - Toggle automatic startup on boot
- Refresh Services: Click Refresh Services to reload
services.conf. - Quit: Click Quit to exit the application.
- System Command: Run
service-trayfrom anywhere in terminal to launch the application.
- Default icons are located in
default_icons. - Custom icons can be placed in
iconsdirectory:green.png– icon when at least one service is runningred.png– icon when all services are stopped
- Python 3.x
- Linux with systemd
- GTK3 and AppIndicator support
Dependencies are automatically installed via install.sh:
- Debian/Ubuntu:
python3-gi,gir1.2-appindicator3-0.1,libcairo2-dev,libgirepository-1.0-dev,gobject-introspection,pkg-config,python3-dev,python3-pip - Arch/Manjaro:
python-gobject,libappindicator-gtk3,python-pip - Fedora:
python3-gobject,libappindicator-gtk3,python3-pip
- Service Tray uses sudo to start/stop/restart/enable/disable services.
- The first time a service is toggled, you will be prompted for your password.
- After that, sudo rules are cached until the session ends.
- Install development dependencies:
sudo apt install python3-gi gir1.2-appindicator3-0.1 python3-dev- Edit
service-tray.pyorservices.conf. - Test changes by running:
./service-tray.pyCurrent Version: 1.2.0
See CHANGELOG.md for detailed version history and changes.
This project is licensed under the MIT License.
- Fork the repository.
- Make your changes.
- Submit a pull request.
- Ensure
install.shand README instructions are updated if needed.
LavRottweiler – GitHub Profile
Last Updated: October 12, 2025