18 Commits

Author SHA1 Message Date
Joachim Hummel
a6cdad5082 Fix battery tray icon vanishing after boot
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>
2026-05-16 23:16:39 +02:00
Joachim Hummel
2e65dadfa9 Add low-battery warning and auto-shutdown to the tray icon
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>
2026-05-16 23:03:54 +02:00
Joachim Hummel
19f1e2962e Read battery state over I2C instead of the kernel module
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>
2026-05-16 22:58:20 +02:00
Joachim Hummel
462dc2d380 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>
2026-05-16 22:31:12 +02:00
Jeff Curless
0fc4287b44 Make this work on argonEon
Seems to.
2025-12-30 18:49:23 -05:00
Jeff Curless
65774dbeaa Add support for network and cooling fan
Add support for a network display, and for a coolin fan.  Note that at
the moment we support one and only one coolin fan, along with the CPU
fan.
2025-12-10 18:22:38 -05:00
Jeff Curless
adab150746 Add process to allow modified smartctl commands 2025-11-19 23:12:54 -05:00
Jeff Curless
1d07d8196a Add support for Argon40 EON
The argon40 EON is a RPI4 with case fan, and 4 drives.
2025-11-03 17:54:15 -05:00
Jeff Curless
778e92fa43 Add support for add extra commands to smartctl
Add extra commands on a drive by drive basis for smartctl
2025-11-02 17:35:34 -05:00
Jeff Curless
a1ac933238 Add support for a configuration file.
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.
2025-11-02 16:10:22 -05:00
Jeff Curless
927f00f655 Update simple monitor
Was not using the same library, now it is.
2025-11-01 18:29:26 -04:00
Jeff Curless
68f8057d8d Modify the code to remove single drive class
Remove the class for single drive data fetching, and so we can modify
the monitor code to make sure we can handle multiple drives
2025-10-26 12:12:30 -04:00
Jeff Curless
6c6fe7065a Make sure the drive temperatures are added
Need to ensure that we add temperatures for each physical drive we add
into the system.
2025-10-20 20:46:25 -04:00
Jeff Curless
9fdd59c424 Add support for multiple drives
Add support to automatialy gather all of the drives in the system and
track there heat and performance.
2025-10-20 20:35:55 -04:00
Jeff Curless
72de0bcea7 Update the monitor code
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)
2025-10-19 19:36:25 -04:00
Jeff Curless
cfadd92430 Update system monitor.
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.
2025-10-13 17:59:47 -04:00
Jeff Curless
fcb9b0ca76 Move original monitor program 2025-10-12 23:16:01 -04:00
Jeff Curless
542cdecab3 Add system monitoring code
Need a way to monitor the system, CPU temp, NVMe temp, etc
2025-10-12 23:02:09 -04:00