Files
hyprmonitors/hyprmonitors.service
2025-08-15 16:28:28 +05:30

50 lines
1.4 KiB
Desktop File

[Unit]
Description=Hyprland Monitor Control Server
Documentation=https://github.com/your-username/hyprmonitors
After=graphical-session.target
Wants=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/local/bin/hyprmonitors
Restart=always
RestartSec=5
User=%i
Group=users
# Environment variables
Environment=RUST_LOG=info
Environment=HYPRMONITORS_HOST=127.0.0.1
Environment=HYPRMONITORS_PORT=3000
Environment=HYPRMONITORS_LOG_LEVEL=info
# Ensure Hyprland environment is available
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=HYPRLAND_INSTANCE_SIGNATURE=%i
# Security settings
NoNewPrivileges=true
PrivateTmp=true
ProtectHome=read-only
ProtectSystem=strict
ReadWritePaths=/tmp
# Resource limits
LimitNOFILE=1024
MemoryMax=128M
[Install]
WantedBy=default.target
# Installation Instructions:
# 1. Build the project: cargo build --release
# 2. Copy binary: sudo cp target/release/hyprmonitors /usr/local/bin/
# 3. Copy service file: sudo cp hyprmonitors.service /etc/systemd/system/hyprmonitors@.service
# 4. Enable for your user: systemctl --user enable hyprmonitors@$USER.service
# 5. Start the service: systemctl --user start hyprmonitors@$USER.service
# 6. Check status: systemctl --user status hyprmonitors@$USER.service
#
# For system-wide installation, modify paths and use:
# sudo systemctl enable hyprmonitors@username.service
# sudo systemctl start hyprmonitors@username.service