# 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 ```sh PYTHONPATH=/root/monitor-wt/disk-monitor/lightgui_python python3 examples/monitor_disk_monitor/main.py ``` ## Screenshot ![Disk Monitor (Python)](screenshot.png) ## Source - App: `examples/monitor_disk_monitor/main.py` - Repo: https://github.com/cnmcdee/lightgui_python - C port: `examples/monitor/disk-monitor/main.cpp` in https://github.com/cnmcdee/lightgui - Rust port: `crates/xframe-demo/examples/monitor_disk_monitor/main.rs` in https://github.com/cnmcdee/lightgui_rust