From 4256c3b86f05a2280fd0af33abf5bbf67b8103cb Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 24 Apr 2026 21:17:50 +0200 Subject: [PATCH] gpu applet: use configurable warm/hot thresholds from module config --- nix/hm-module.nix | 13 ++++++++++++- shell/applets/GpuApplet.qml | 2 +- shell/services/Modules.qml | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/nix/hm-module.nix b/nix/hm-module.nix index f20a3eb..c706f45 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -87,7 +87,6 @@ in "bluetooth" "network" "powerProfile" - "gpu" "cpu" "memory" "idleInhibitor" @@ -171,6 +170,18 @@ in description = "Brightness adjustment step (%)."; }; }; + gpu = moduleOpt "gpu" { + warm = lib.mkOption { + type = lib.types.int; + default = 70; + description = "GPU temperature threshold for warm state (°C)."; + }; + hot = lib.mkOption { + type = lib.types.int; + default = 85; + description = "GPU temperature threshold for hot state (°C)."; + }; + }; temperature = moduleOpt "temperature" { warm = lib.mkOption { type = lib.types.int; diff --git a/shell/applets/GpuApplet.qml b/shell/applets/GpuApplet.qml index 65164be..896b1e0 100644 --- a/shell/applets/GpuApplet.qml +++ b/shell/applets/GpuApplet.qml @@ -158,7 +158,7 @@ Column { height: 22 label: "Temp" value: S.SystemStats.gpuTempC + "\u00B0C" - valueColor: S.SystemStats.gpuTempC > 85 ? S.Theme.base08 : S.SystemStats.gpuTempC > 70 ? S.Theme.base0A : S.Theme.base05 + valueColor: S.SystemStats.gpuTempC > S.Modules.gpu.hot ? S.Theme.base08 : S.SystemStats.gpuTempC > S.Modules.gpu.warm ? S.Theme.base0A : S.Theme.base05 } Item { diff --git a/shell/services/Modules.qml b/shell/services/Modules.qml index 897a38e..2f1bedc 100644 --- a/shell/services/Modules.qml +++ b/shell/services/Modules.qml @@ -60,7 +60,9 @@ QtObject { device: "" }) property var gpu: ({ - enable: true + enable: true, + warm: 70, + hot: 85 }) property var cpu: ({ enable: true