CPU Dashboard — monitor app
CPU Dashboard is the first of the btop-style monitor apps built from LightGUI's XFrame monitor widgets: a Task Manager-style CPU view in one 1024x768 window. Everything on screen is a widget from the registry — no hand-drawn controls — fed live data from /proc/stat and /proc/loadavg, sampled every 500 ms.
What it shows
- Load average (top left) — 1 / 5 / 15 minute load with uptime, colour-coded per core.
- Total CPU bar (top right) — the whole machine's CPU busy percentage.
- Per-core grid (middle left) — one mini history graph per core, each labelled with its current percentage.
- CPU gauge (middle right) — a big dial with the total CPU percentage, a redline zone at 80% and a peak-hold marker (C uses the arc gauge, Rust and Python use the tachometer).
- Total CPU history (bottom) — the total CPU percentage over the last 60 seconds, with current / min / max / average.
Widgets used
- XCoreGrid — per-core mini history graphs
- XArcGauge — big percentage gauge (C)
- XTachometer — tachometer gauge with redline and peak hold (Rust, Python)
- XHistoryGraph — 60-second total CPU history
- XLoadBadge — load average 1 / 5 / 15 min + uptime
- XUsageBar — total CPU percentage bar
Each widget preloads seeded demo data so a fresh widget reads as its kind; the app replaces it with live data on the first sample — the core grid and history are primed with the first real /proc/stat reading, so no demo sine wave is ever visible.
Build and run — C
git clone https://git.lightgui.com/thinkmelt/lightgui.git
cd lightgui/examples/monitor/cpu-dashboard
make
./cpu-dashboardSource: examples/monitor/cpu-dashboard/main.cpp in the lightgui repo (C).
Build and run — Rust
git clone https://git.lightgui.com/thinkmelt/lightgui_rust.git
cd lightgui_rust
cargo run -p xframe-demo --example monitor_cpu_dashboardSource: crates/xframe-demo/examples/monitor_cpu_dashboard/main.rs in the lightgui_rust repo (Rust).
Build and run — Python
git clone https://git.lightgui.com/thinkmelt/lightgui_python.git
cd lightgui_python
PYTHONPATH=. python3 examples/monitor_cpu_dashboard/main.pySource: examples/monitor_cpu_dashboard/main.py in the lightgui_python repo (Python).
Esc, q, or closing the window quits in all three versions. The C screenshot above is the doc feature image; each language's own screenshot is committed next to its source.
Get the code
- lightgui (C)
- lightgui_rust (Rust)
- lightgui_python (Python)