Single-widget monitor app (XTempHistory, 80 C threshold) reading /sys/class/thermal + /sys/class/hwmon every 2 s. hot_dallas has no thermal sensors, so the app shows the widget empty state (no data, no fake readings) with a title that says so. Adds additive MonitorWidget.clear() and an empty-state readout.
1.2 KiB
1.2 KiB
Temperature Monitor — monitor (Python)
A btop-style temperature monitor in one 1024x768 window, built only from LightGUI XFrame monitor widgets:
- XTempHistory — temperature history of the first thermal zone, with an 80 C threshold line (readings above it draw red)
Live data comes from /sys/class/thermal/thermal_zone*/temp and
/sys/class/hwmon/hwmon*/temp*_input, re-scanned every 2 s. On a
machine with sensors the history fills with live readings; on this
machine (hot_dallas, a VPS with no thermal sensors at all — only
cooling devices under /sys/class/thermal/, no thermal_zone*/temp
files, an empty /sys/class/hwmon/) the app shows the widget's
honest empty state: an empty graph, "no data" in the legend, and a
title that says no thermal zones were found. No mock or demo
temperatures: the deterministic demo data is dropped at startup with
MonitorWidget.clear().
Run
PYTHONPATH=. python3 examples/monitor_temperature_monitor/main.py
Esc, q, or closing the window quits.
Source
- App:
examples/monitor_temperature_monitor/main.py - Widget:
lightgui/xframe/monitor.py - Repo: https://github.com/cnmcdee/lightgui_python