Files

Process Manager — monitor (C++)

A btop-style process manager in one 1024x768 window, built only from LightGUI XFrame widgets: XProcessList (live /proc table, sortable columns, click a row to select it), GtkEntry (filter by name or pid), and three GtkButtons — Terminate, Kill, Refresh.

What it shows

  • Processes — pid, program, user, memory and CPU% for the live processes on this machine, refreshed every 2 seconds. 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.
  • Filter — type a name or pid substring; the list re-scans /proc and shows only matching rows.
  • Terminate — sends SIGTERM to the selected process.
  • Kill — sends SIGKILL to the selected process.
  • Refresh — re-scans /proc immediately.

Safety: Terminate/Kill act on the selected row's pid only, and refuse pid ≤ 1 and the manager's own pid.

Build and run

make                # produces ./process-manager
./process-manager   # under Xvfb or a real X server; Esc quits

Source

  • App: examples/monitor/process-manager/main.cpp in lightgui
  • Widgets: XProcessList, GtkButton, GtkEntry (this app adds row-selection and a name/pid filter to XProcessList; additive only, the widget demo is unchanged)

The same app exists in Rust and Python — see the walkthrough.