XSysBox
XSysBox is a Monitor widget in LightGUI's XFrame widget set. Composite resource box: title, big number, history graph, usage bar.
XSysBox is the btop box in one widget: a title, one big number, a history graph and a usage bar, stacked the way btop stacks CPU, MEM and NET. One box per resource, one value per tick — build a dashboard out of boxes.

Key methods
set_text(t)— the box titleset_unit(u)— the unit shown with the big numberset_value(v)— the current value; feeds the number, graph and barget_value()— the current valueset_max(m)— the value that fills the graph and barget_max()— the current maximum
Every widget also gets the shared properties visible, enabled, bounds (x, y, width, height) and style_name, plus the background / foreground colours from the active style.
Example
One set_value per tick drives the big number, the history graph and the bar together.
XSysBox widget(display, screen, window, gc, &styles, 20, 20, 360, 200);
widget.set_text("CPU");
widget.set_unit("%");
widget.set_max(100.0);
widget.set_value(63.0);
widget.draw();The snippet above is the widget part only. As with every XFrame example, the full program opens a display, creates a window and a style manager, then runs the standard event loop — see the complete example in the repo.
Build it from the repo root:
g++ -std=c++17 -Iwidgets/components -Iwidgets examples/XSysBox.cpp -lX11 -o XSysBoxRun it under Xvfb or a real X server; close the window to quit.
Example in the repo
The full working example is examples/XSysBox.cpp in the lightgui repo (C is canonical). The same widget is ported to the Rust and Python repos under the same name — see the links below.
Get the code
These widgets ship in all three LightGUI repos:
- lightgui (C)
- lightgui_rust (Rust)
- lightgui_python (Python)