Process Manager — monitor app
Process Manager is a btop-style process manager in one 1024x768 window — the first of the ten Stage 2 monitor apps built from the new XFrame monitor widgets. It shows the live processes on the machine, lets you filter them, and lets you terminate or kill the one you selected. Every visible UI element is a LightGUI XFrame widget; there is no hand-drawn UI.
What it shows
- Processes — pid, program, user, memory and CPU% for the live processes on this machine, refreshed every 2 seconds from
/proc. Click a column header to sort by it (click again to reverse); click a body row to select it (highlighted). CPU% is the lifetime average, with an in-cell bar; rows over 50% CPU are highlighted. - Filter — type a name or pid substring in the entry and the list re-scans
/procand shows only matching rows. - Terminate — sends
SIGTERMto the selected process. - Kill — sends
SIGKILLto the selected process. - Refresh — re-scans
/procimmediately.
Safety: Terminate and Kill act on the selected row's pid only, and refuse pid ≤ 1 and the manager's own pid.
Widgets used
- XProcessList — the live process table. This app adds row selection and a name/pid filter to the widget (additive only; the widget demo is unchanged). C++:
XProcessList; Rust:MonitorWidgetkindProcessList; Python:MonitorWidgetkindXProcessList. - GtkButton — Terminate, Kill and Refresh.
- GtkEntry — the filter text field.
Build and run — C++
make # in examples/monitor/process-manager — produces ./process-manager
./process-manager # under Xvfb or a real X server; Esc quitsBuild and run — Rust
cargo run -p xframe-demo --example monitor_process_manager
# Esc or close the window to quitBuild and run — Python
PYTHONPATH=/root/pm-work/lightgui_python python3 examples/monitor_process_manager/main.py
# Esc or close the window to quitSource
- C++: lightgui —
examples/monitor/process-manager/(main.cpp,Makefile,README.md) - Rust: lightgui_rust —
crates/xframe-demo/examples/monitor_process_manager.rs - Python: lightgui_python —
examples/monitor_process_manager/main.py
Widget additions live on the monitor-apps/process-manager branch in each repo: selection + filter in XProcessList (C++), MonitorWidget filter + selected_pid() (Rust), and MonitorWidget set_filter() / select_at() / selected_pid() (Python).