The wait loop polled QSystemTrayIcon.isSystemTrayAvailable(), but Qt5
caches that value from the moment QApplication is constructed. At login
the autostart wins the race against wf-panel-pi's tray, so Qt caches
"no tray" permanently, the loop never escapes, and the process hangs
until the 120s timeout and exits.
Add wait_for_tray(), which polls the session bus directly (dbus-send
NameHasOwner for org.kde.StatusNotifierWatcher) before QApplication is
constructed, so Qt reports the tray correctly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The oneUpPower kernel module powered the system off at low SOC, but the
icon now reads the battery over I2C and no longer relies on that module.
Restore the safety net in the icon itself.
While running on battery, warn via a tray notification at <=10% and run
`systemctl poweroff` at <=5%. systemctl poweroff is authorised for the
active desktop session without sudo (logind CanPowerOff returns "yes").
State resets when AC is reconnected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
batteryIcon.py read SOC and AC status from /sys/class/power_supply,
which only exists when the oneUpPower kernel module is loaded. When the
module fails to load (e.g. a DKMS vermagic mismatch after a kernel
update), the icon showed only "N/A".
Read the battery IC directly over I2C (bus 1, addr 0x64, regs 0x04 and
0x0E -- the same registers oneUpPower.c uses) via smbus2. force=True
bypasses the I2C_SLAVE busy check so the read still works whether or not
the kernel module has claimed the address. The icon now works for an
ordinary user in the i2c group, with no sudo and no kernel module.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
Adding a coniguration file (/etc/sysmon.ini). This will allow users to
no monitor the temperature of speciic drives by ignoring them, as well
as ignoring the performance from specific drives.
For instance on a system running mdraid, you could ignore performance on
all of the drives that make up the raid array, and ignore the
temperature of the raid device.
Changes made to the monitor code to remove all warnings from
systemsupport.py. Note there are warnings in oneUpMon, however these do
not appear to be valid, as some of them complain about attributes not
existing, when they clearly do (Qt.AlignBottom for instance)
Overall cleanup, and modificaton to the disk chart. System tracks Byte,
KiB and MiB transfer rates. Can't realld support GiB because I'm no
sure the PCIe bus can handle that.
Modifed the Y-Axis for disks so it displays the data on the closest
power of 2 scale. Seems to be a reasonable way to modify the scale so we
can actually see some of the smaller writes.