How elshadhu/systui works
systui is a cross-platform terminal monitor. Its main loop refreshes system metrics and process samples, groups processes into apps, updates history and list state, then renders the selected view and status lines. The graph preserves the documented Apps, Lifetime and Overview capabilities, plus process grouping, insights and platform-specific metrics. Edges are limited to sampled calls/import references and README-described behavior; unsampled implementation details and some internal view wiring are omitted.
Main entry points: model.go Refresh and view model · appsView.go Apps and Lifetime views · group.go App grouping and sorting · topbar.go Status and insight lines
Components 19
Runtime and UI
- Program entry
main.go - Refresh and view model
ui/model.go - Color themes
ui/theme/theme.go
Process Monitoring
- Process sampler
internal/proc/sampler.go - Process details and usage
internal/proc - App grouping and sorting
internal/apps/group.go - Helper process roles
internal/apps/role.go - App metric history
internal/apps/history.go
System Metrics
- CPU metrics
internal/metrics/cpu.go - Memory and pressure
internal/metrics/mem.go
Views and Insights
- Insight ranking
internal/insight/insight.go - Expandable app list
ui/applist/state.go - Apps and Lifetime views
ui/appsView.go - Overview panels
ui/overview.go - Status and insight lines
ui/topbar.go - Responsive columns
ui/columns.go - Trend rendering
ui/draw/sparkline.go - Terminal drawing
ui/draw
Other components
- Terminal user
Connections 29
- Terminal user → Program entry: runs
- Program entry → Refresh and view model: starts UI
main.go - Program entry → Color themes: selects theme
main.go - Refresh and view model → Process sampler: samples processes
ui/model.go - App grouping and sorting → Process details and usage: groups process stats
internal/apps/group.go - Refresh and view model → App grouping and sorting: builds groups
ui/model.go - Refresh and view model → CPU metrics: reads CPU
ui/model.go - Refresh and view model → Memory and pressure: reads memory pressure
ui/model.go - Refresh and view model → App metric history: records samples
ui/model.go - Refresh and view model → Expandable app list: installs groups
ui/model.go - Refresh and view model → Insight ranking: ranks insights
ui/model.go - Insight ranking → App grouping and sorting: checks app peaks
internal/insight/insight.go - Insight ranking → Memory and pressure: checks system pressure
internal/insight/insight.go - Refresh and view model → Apps and Lifetime views: renders app tabs
ui/model.go - Refresh and view model → Overview panels: renders overview
ui/model.go - Refresh and view model → Status and insight lines: renders status lines
ui/model.go - Apps and Lifetime views → Expandable app list: reads list state
ui/appsView.go - Apps and Lifetime views → App grouping and sorting: renders grouped data
ui/appsView.go - Apps and Lifetime views → Responsive columns: uses layout
ui/appsView.go - Apps and Lifetime views → Trend rendering: draws trends
ui/appsView.go - Overview panels → Terminal drawing: uses drawing
ui/overview.go - Status and insight lines → Insight ranking: shows insights
ui/topbar.go - Status and insight lines → Memory and pressure: shows pressure and swap
ui/topbar.go - Status and insight lines → Terminal drawing: fits status fields
ui/topbar.go - Trend rendering → App metric history: draws metric history
ui/draw/sparkline.go - Responsive columns → Terminal drawing: uses column widths
ui/columns.go - Apps and Lifetime views → Terminal drawing: formats rows
ui/appsView.go - Refresh and view model → Color themes: uses selected theme
ui/model.go - App grouping and sorting → Helper process roles: labels helper processes