Initial battery monitoring solution added.

This commit is contained in:
Storm Dragon
2025-08-07 20:54:20 -04:00
parent 2fa5e2d9af
commit e1434f6423
5 changed files with 258 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
[Unit]
Description=Battery Monitor for Stormux Gaming Image
Documentation=man:battery_monitor.py(1)
After=multi-user.target
ConditionPathExists=/sys/class/power_supply
[Service]
Type=simple
ExecStart=/usr/local/bin/battery_monitor.py
Restart=always
RestartSec=10
User=root
Group=root
# Security settings
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
ReadWritePaths=/var/log
ReadOnlyPaths=/sys/class/power_supply
# Allow access to speech and audio
SupplementaryGroups=audio
# Environment
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=multi-user.target