From 2677eb06953497a472bd77c814742f9eb164ca0c Mon Sep 17 00:00:00 2001 From: jchas2 Date: Mon, 27 Jul 2026 06:30:41 +1000 Subject: [PATCH 1/3] Gpu / Cpu switches on startup --- README.md | 5 +++-- src/taskmon/Actions/ShowUsageAction.cs | 2 ++ src/taskmon/Assets/Themes/Alien Blood.theme | 2 +- src/taskmon/Configuration/Constants.cs | 2 ++ .../Gui/Controls/ProcessControl.Columns.cs | 10 ++++----- src/taskmon/TaskMonApp.cs | 21 +++++++++++++++++++ tests/Task.Monitor.Tests/TaskMonAppTests.cs | 3 --- 7 files changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7fee193..0656b04 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,9 @@ management functions.

## Features -- **No sudo or administrator privilege required** - Native platform APIs used on each platform. -- Written in C# using platform native interop for maximum performance and minimum memory overhead. +- **Perfect for HomeLab and Local LLM monitoring** +- **No sudo or administrator privilege required** +- Written in C# using platform native interop for maximum performance and minimum memory overhead (zero third-party dependencies) - **Real-Time System Monitoring**: Live updates of CPU, GPU, memory, swap, disk I/O and Network I/O. - High resolution charts in 24-bit colour. - Switch layouts (`F8`) to focus charts on specific system metrics. diff --git a/src/taskmon/Actions/ShowUsageAction.cs b/src/taskmon/Actions/ShowUsageAction.cs index 98c62c7..cafa649 100644 --- a/src/taskmon/Actions/ShowUsageAction.cs +++ b/src/taskmon/Actions/ShowUsageAction.cs @@ -13,6 +13,8 @@ public int Run() Usage: {Constants.AppName} [options] Options: + --gpu-only Show Gpu Charts and sort process list by Gpu% on startup + --cpu-only Show Cpu Charts and sort process list by Cpu% on startup --pid PID Monitor the given process PID -u --username Only show processes for the the given user NAME -p --process Only show processes with matching process NAME diff --git a/src/taskmon/Assets/Themes/Alien Blood.theme b/src/taskmon/Assets/Themes/Alien Blood.theme index 43870f2..7a07772 100644 --- a/src/taskmon/Assets/Themes/Alien Blood.theme +++ b/src/taskmon/Assets/Themes/Alien Blood.theme @@ -5,7 +5,7 @@ background=#0f1610 background-highlight=#1d4125 col-cmd-normal-user-space=#327f77 -col-cmd-low-priority=#121d18 +col-cmd-low-priority=#10b981 col-cmd-high-cpu=#b082d1 col-cmd-io-bound=#dff0e6 col-cmd-script=#dff0e6 diff --git a/src/taskmon/Configuration/Constants.cs b/src/taskmon/Configuration/Constants.cs index d0d3b4c..24a393c 100644 --- a/src/taskmon/Configuration/Constants.cs +++ b/src/taskmon/Configuration/Constants.cs @@ -20,6 +20,8 @@ public sealed class Sections public const string ThemeMsDos = "MS-DOS"; public const string LayoutAllCharts = "All Charts"; + public const string LayoutGpuAndGpuMemoryLarge = "Gpu And Gpu Memory Large"; + public const string LayoutCpuAndMemoryLarge = "Cpu And Memory Large"; } public sealed class Keys diff --git a/src/taskmon/Gui/Controls/ProcessControl.Columns.cs b/src/taskmon/Gui/Controls/ProcessControl.Columns.cs index 463c538..1196a17 100644 --- a/src/taskmon/Gui/Controls/ProcessControl.Columns.cs +++ b/src/taskmon/Gui/Controls/ProcessControl.Columns.cs @@ -7,14 +7,14 @@ public partial class ProcessControl internal const int ColumnProcessWidth = 32; internal const int ColumnPidWidth = 7; internal const int ColumnUserWidth = 16; - internal const int ColumnPriorityWidth = 4; + internal const int ColumnPriorityWidth = 5; internal const int ColumnCpuWidth = 7; - internal const int ColumnAvgCpuWidth = 9; - internal const int ColumnMaxCpuWidth = 9; + internal const int ColumnAvgCpuWidth = 10; + internal const int ColumnMaxCpuWidth = 10; internal const int ColumnThreadsWidth = 7; internal const int ColumnGpuWidth = 7; - internal const int ColumnAvgGpuWidth = 9; - internal const int ColumnMaxGpuWidth = 9; + internal const int ColumnAvgGpuWidth = 10; + internal const int ColumnMaxGpuWidth = 10; internal const int ColumnMemoryWidth = 10; internal const int ColumnAvgMemoryWidth = 10; internal const int ColumnMaxMemoryWidth = 10; diff --git a/src/taskmon/TaskMonApp.cs b/src/taskmon/TaskMonApp.cs index 1f446e9..1f2c40c 100644 --- a/src/taskmon/TaskMonApp.cs +++ b/src/taskmon/TaskMonApp.cs @@ -163,6 +163,27 @@ internal bool ProcessArgs(string[] args, out List actions) } } + bool isGpuOnly = args.Contains("--gpu-only"); + bool isCpuOnly = !isGpuOnly && args.Contains("--cpu-only"); + + if (isGpuOnly || isCpuOnly) { + var (layoutName, sortCol) = isGpuOnly + ? (Constants.Sections.LayoutGpuAndGpuMemoryLarge, Statistics.Gpu) + : (Constants.Sections.LayoutCpuAndMemoryLarge, Statistics.Cpu); + + Layout? defaultLayout = runContext.AppConfig.Layouts.FirstOrDefault(l => + l.Name.Equals(layoutName, StringComparison.CurrentCultureIgnoreCase)); + + if (defaultLayout != null) { + runContext.AppConfig.DefaultLayout = defaultLayout; + runContext.AppConfig.SortColumn = sortCol; + } + else { + OutputWriter.Error.WriteLine($"{Constants.AppName}: Layout {layoutName} not found"); + result = false; + } + } + if (!result || args.Any(arg => arg == "-h" || arg == "--help")) { actions.Add(new ShowUsageAction()); return result; diff --git a/tests/Task.Monitor.Tests/TaskMonAppTests.cs b/tests/Task.Monitor.Tests/TaskMonAppTests.cs index 6edc25e..5fab7cf 100644 --- a/tests/Task.Monitor.Tests/TaskMonAppTests.cs +++ b/tests/Task.Monitor.Tests/TaskMonAppTests.cs @@ -78,9 +78,6 @@ public static TheoryData InvalidArgData() { "--delay", "-1500", $"{Constants.AppName}: bad delay arg: -1500" }, { "--limit", "1oo", $"{Constants.AppName}: bad limit arg: 1oo" }, { "--limit", "-10", $"{Constants.AppName}: bad limit arg: -10" }, - { "--delay", "!#@$%^#$@", $"{Constants.AppName}: bad delay arg: !#@$%^#$@" }, - { "--delay", "200", $"{Constants.AppName}: bad delay arg: 200" }, - { "--delay", "-1500", $"{Constants.AppName}: bad delay arg: -1500" }, { "--nprocs", "4g77h", $"{Constants.AppName}: bad nprocs arg: 4g77h" }, { "--nprocs", "0", $"{Constants.AppName}: bad nprocs arg: 0" }, { "--nprocs", "-12", $"{Constants.AppName}: bad nprocs arg: -12" }, From 4eb30dea14adf13164f531fd8a59341d189ed5e5 Mon Sep 17 00:00:00 2001 From: jchas2 Date: Mon, 27 Jul 2026 06:31:10 +1000 Subject: [PATCH 2/3] Gpu / Cpu switches on startup --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0656b04..ebae977 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ taskmgr-cli icon Task Monitor -

A modern, powerful cross-platform terminal-based task monitor designed to provide real-time monitoring and management of a computer's performance, active processes, and resource utilization. -Originally inspired by tools like top, htop and the Windows Task Manager, it provides performance monitoring at-a-glance for system resources (including CPU, GPU, Memory, Swap, Disk and Network) and process -management functions.

+

A modern, powerful cross-platform terminal-based task monitor providing real-time monitoring and management of a computer's performance, active processes, and resource utilization. Perfect for Homelab and local LLM monitoring. +Originally inspired by tools like top, htop and the Windows Task Manager, it provides performance monitoring at-a-glance for system resources (including CPU, GPU, Memory, Swap, Disk and Network) and process management functions.

[![Homebrew](https://img.shields.io/badge/homebrew-orange?style=flat-square&logo=homebrew&logoColor=white)](#macos-on-apple-silicon) [![Chocolatey](https://img.shields.io/badge/chocolatey-blue?style=flat-square&logo=chocolatey&logoColor=white)](#windows-on-x64-and-arm64) @@ -20,7 +19,7 @@ management functions.

- **Perfect for HomeLab and Local LLM monitoring** - **No sudo or administrator privilege required** -- Written in C# using platform native interop for maximum performance and minimum memory overhead (zero third-party dependencies) +- **Cross-Platform native performance**: Written in C# using platform native interop for maximum performance and minimum memory overhead (zero third-party dependencies) - **Real-Time System Monitoring**: Live updates of CPU, GPU, memory, swap, disk I/O and Network I/O. - High resolution charts in 24-bit colour. - Switch layouts (`F8`) to focus charts on specific system metrics. @@ -47,9 +46,9 @@ management functions.

- **System profile**: Display machine name, OS name and version, CPU name and clock speed, top resource consumers (Avg and Max) (using the `F9` function). **Cross-Platform Native Performance** -- Platform-specific optimizations using native APIs (Win32, Mach kernel). -- .net native with small memory footprint. -- No dependencies on libraries such as ncurses. +- Platform-specific optimizations using C APIs (Win32, Mach kernel). +- .net native build with small memory footprint. +- Zero third-party dependencies on libraries such as ncurses. ## Installation From e68aacc79482493abbe017e90dcc46a304c46305 Mon Sep 17 00:00:00 2001 From: jchas2 Date: Mon, 27 Jul 2026 06:34:54 +1000 Subject: [PATCH 3/3] Gpu / Cpu switches on startup --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ebae977..2d4b23d 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,8 @@ Task Monitor supports the following commands on startup. Note these commands can | Command | What it does | |---------|--------------| | `taskmon` | Start Task Monitor with configuration defaults. | +| `taskmon --gpu-only` | Automatically monitor GPU resources on startup. | +| `taskmon --cpu-only` | Automatically monitor CPU resources on startup. | | `taskmon --pid ` | Automatically monitor the pid nnn on startup. | | `taskmon --username ` | Automatically monitor all processes running under user on startup. | | `taskmon --process ` | Automatically monitor all processes with matching on startup. | @@ -147,8 +149,8 @@ Task Monitor stores configuration and log files in the following system director ### Windows -| Config | Path | Description | -|--------|------|-------------| +| Config | Path | +|--------|------| | `taskmon.ini` | `~\AppData\Roaming\taskmon` | | Theme files | `~\AppData\Roaming\taskmon\themes` | | Layout files | `~\AppData\Roaming\taskmon\layouts` |