Files
KH_Clock/KH-clock.service
2026-02-25 00:23:08 -06:00

28 lines
699 B
Desktop File

[Unit]
Description=KH Clock Display
After=network.target
DefaultDependencies=no
[Service]
Type=simple
User=sasha
WorkingDirectory=/opt/KH_Clock
# SDL renders offscreen; pixels are blit directly to /dev/fb0 (Amlogic kmsdrm is unsupported)
Environment=SDL_VIDEODRIVER=offscreen
Environment=PYTHONUNBUFFERED=1
# Disable console blanking so the TV stays on
ExecStartPre=/bin/sh -c 'echo -ne "\033[9;0]" > /dev/tty1'
# If using a virtualenv (recommended):
ExecStart=/opt/KH_Clock/venv/bin/python3 /opt/KH_Clock/main.py
# If using system Python instead, replace the line above with:
# ExecStart=/usr/bin/python3 /opt/KH_Clock/main.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target