waoziandClaude Opus 5.5 9c26d44122 Expand applications to their processes and read AMD/Intel GPU use
Clicking a window in Applications lists the processes counted toward it,
each with state, CPU, memory and GPU. Model.ProcessOwner exposes the
ownership AppUsages already computes.

Per-process GPU shares no longer need NVIDIA: gpu_drm.zi reads the
kernel's standard DRM fdinfo counters (nanosecond engines with capacity,
or cycle pairs), counts each client once and reports its busiest engine.
The GPU column appears only when a source has data instead of showing
n/a. CPU and GPU shares below 10% show one decimal, so light use on a
many-core machine no longer reads 00. The NVML helper names itself
taskmgr-gpu instead of exe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 01:32:47 -03:00

taskmgr

A task manager for Linux written in Ziran with Kryon widgets. It reads /proc directly: process names, states, CPU percentages, and resident memory, plus total CPU and memory usage.

Interface

The window keeps the compact structure of the Windows 2000 Task Manager while installing the host application's palette when one is supplied, or the current Linux desktop palette for a standalone window. That palette covers the menu bar, Applications / Processes / Performance tabs, bordered content and the three-pane status bar.

  • Applications lists top-level EWMH windows and can switch to one, request that it close, or open a new command. CPU, Memory and GPU columns total each window's process tree: its _NET_WM_PID plus every descendant that no nearer listed window owns. Clicking a window expands it to those processes. Windows without a PID show -. Only top-level desktop windows appear, so background services do not, and under Wayland only XWayland windows do. Per-process GPU shares come from DRM fdinfo counters (AMD, Intel and other drivers that publish them) and, on NVIDIA's driver, from NVML sampled by taskmgr --gpu-helper (taskmgr-gpu), a display-free child of the same binary that runs only while this tab or Performance is open, so NVML's memory never enters the window process. The GPU column appears only once a source has data. Shares below 10% show one decimal.
  • Processes is a sortable DataViews table with image name, PID, CPU, CPU time and resident memory. Rows are grouped by image name by default, with all Codex-family processes combined under codex; Options → Group Processes toggles the grouping. Clicking an aggregate row expands or collapses its real process rows. Selecting any cell highlights the complete row. End Process sends SIGTERM to one member; End Group sends it to every current member and reports any partial failure.
  • Performance shows 60-sample CPU, memory, GPU and VRAM histories as clean Windows-style colored lines on black, plus process, thread, handle, physical-memory, commit and kernel-memory totals. Every detected DRM card has a stable cardN label, distinct graph color and independent GPU/VRAM reading; unsupported counters display n/a. NVIDIA's driver has no sysfs GPU counters, so its cards use the same --gpu-helper NVML samples as the Applications tab, matched to cardN by PCI address, while this tab or Applications is open. Memory values use explicit adaptive B, KB, MB, GB or TB units.
  • File, Options, View and Help menus provide Run, refresh speed, manual refresh, kernel-time display, process grouping, end-process confirmation and About actions.
  • Ctrl+1, Ctrl+2 and Ctrl+3 switch to Applications, Processes and Performance, matching the visible tab order.

The model refreshes once a second by default and reads /proc directly. TASKMGR_TAB=applications|processes|performance selects the initial tab, which is useful for headless rendering and tests.

The native window starts at a compact, resizable 400 × 480 size. Kryon's software pixel presenter is the default because taskmgr already rasterizes its widgets on the CPU; this avoids loading Mesa's LLVM/Gallium stack just to copy that finished frame. Set KRYON_PIXMAP_GPU=1 before launch to opt into GPU presentation when that tradeoff is useful.

Build and run

make            # ziran tool kryon build
make run        # open the desktop window
make test       # native model tests (no display needed)
make x11-test   # native app and Applications actions on a private Xvfb display
make memory-test # steady native RSS on private Xvfb; must stay below 30 MiB
make shot       # render one frame to build/taskmgr.ppm
make check      # compile every module
make package    # dist/taskmgr-linux-amd64.deb and dist/taskmgr-linux-x86_64.AppImage

make package stages the app with ziran install, moves libraries the build produced (such as libkryonavif.so) to /usr/lib/taskmgr and points the program's RUNPATH there. It needs patchelf, dpkg-deb, dpkg-shlibdeps and, for the AppImage, LINUXDEPLOY set to a linuxdeploy AppImage. The release workflow publishes both files under these version-free names, so https://github.com/kryonlabs/taskmgr/releases/latest/download/taskmgr-linux-amd64.deb and .../taskmgr-linux-x86_64.AppImage always fetch the newest release.

make x11-test never touches the current desktop. It needs Xvfb, xfwm4 (or X11_TEST_WM), xterm and xprop; when one is absent it reports a skip. make memory-test likewise uses only a scrubbed private Xvfb display, waits for several process and retained-text refreshes, then enforces a 30 MiB RSS cap.

The desktop profile opens an SDL2 window through Kryon's desktop backend. The tui, web, portable, and headless shot profiles use the same application Frame declared in ziran.toml.

S
Description
Linux task manager for monitoring processes, CPU and memory.
Readme
127 KiB
0 Stars 1 Watchers 0 Forks
No results found.
Languages
Ziran 90.4%
Shell 8.8%
Makefile 0.8%