gpu applet: use configurable warm/hot thresholds from module config

This commit is contained in:
Damocles 2026-04-24 21:17:50 +02:00
parent 42d11e7a14
commit 4256c3b86f
3 changed files with 16 additions and 3 deletions

View file

@ -87,7 +87,6 @@ in
"bluetooth" "bluetooth"
"network" "network"
"powerProfile" "powerProfile"
"gpu"
"cpu" "cpu"
"memory" "memory"
"idleInhibitor" "idleInhibitor"
@ -171,6 +170,18 @@ in
description = "Brightness adjustment step (%)."; 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" { temperature = moduleOpt "temperature" {
warm = lib.mkOption { warm = lib.mkOption {
type = lib.types.int; type = lib.types.int;

View file

@ -158,7 +158,7 @@ Column {
height: 22 height: 22
label: "Temp" label: "Temp"
value: S.SystemStats.gpuTempC + "\u00B0C" 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 { Item {

View file

@ -60,7 +60,9 @@ QtObject {
device: "" device: ""
}) })
property var gpu: ({ property var gpu: ({
enable: true enable: true,
warm: 70,
hot: 85
}) })
property var cpu: ({ property var cpu: ({
enable: true enable: true