Files
lightgui_python/examples/monitor_disk_monitor
Muse b197a366ec Disk Monitor app (Stage 2): live per-mount usage bars, Used/Free stack bar, read/write IO history graph
1024x768 window, 1 s refresh from /proc/mounts + os.statvfs and
/proc/diskstats. XUsageBar + XStackBar + XHistoryGraph; seeded demo
data replaced on first tick (push/set_segments start fresh own
data). Harness background is the widgets near-black panel color
(XStackBar paints no panel of its own). XSysBox deliberately unused
(no clear-history API, constructor seeds 60 demo samples).
Screenshot verified 1024x768 on :116. Tests: 363 OK.
2026-12-05 20:13:54 +00:00
..

Disk Monitor — Python (XFrame)

A live disk monitor in one 1024x768 window: per-mount usage bars, a Used / Free stack bar for the largest mount, and a read/write throughput history graph. All data is live — /proc/mounts + os.statvfs for usage, /proc/diskstats (sectors differenced once a second) for MB/s. Refreshes every second via GLib.timeout_add; close the window to quit.

Widgets used

Widget Role
XUsageBar One per disk mount: usage % with total size
XStackBar Largest mount split into Used / Free (GiB)
XHistoryGraph Read MB/s + Write MB/s history, 60 s window

Seeded demo series/segments are replaced by live data on the first tick (push() / set_segments() start fresh own data, never the demo). The harness background is the widgets' near-black panel color — XStackBar paints no panel of its own, so a white background would wash its light-grey legend out. Note the Python XStackBar draws no title (its draw ignores the label prop); the C/Rust ports show "/ disk usage" there.

Why no XSysBox: it has no clear-history API and its constructor seeds 60 demo samples, so it cannot show live disk data without the seeded demo leaking into the history.

Build & run

PYTHONPATH=/root/monitor-wt/disk-monitor/lightgui_python python3 examples/monitor_disk_monitor/main.py

Screenshot

Disk Monitor (Python)

Source