Add battery tray icon with reliable autostart

Add batteryIcon.py, a PyQt5 system tray icon for the Argon ONE UP
that shows battery SOC and charging status, plus an XDG autostart
entry (batteryIcon.desktop).

The icon now waits up to 120s for the system tray to become
available instead of exiting immediately. At login the autostart
entry runs before the labwc panel (wf-panel-pi) provides its tray,
which previously caused the script to sys.exit(1) and the icon to
be missing after every reboot.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joachim Hummel
2026-05-16 22:31:12 +02:00
parent b8650dc702
commit 462dc2d380
2 changed files with 172 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=Battery Icon
Comment=Battery tray icon for Argon ONE UP
Exec=/usr/bin/python3 /home/joachim/git/battery-argon40/monitor/batteryIcon.py
Icon=battery
Terminal=false
Categories=System;Monitor;
X-GNOME-Autostart-enabled=true