From 842249e05ae84dbdba1b4f4b50af2b7bf45826e2 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 25 Aug 2025 17:37:04 +1000 Subject: config: add gpu type config --- services/SystemUsage.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'services') diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml index 6ee4e42..bd02da3 100644 --- a/services/SystemUsage.qml +++ b/services/SystemUsage.qml @@ -1,5 +1,6 @@ pragma Singleton +import qs.config import Quickshell import Quickshell.Io import QtQuick @@ -9,7 +10,8 @@ Singleton { property real cpuPerc property real cpuTemp - property string gpuType: "NONE" + readonly property string gpuType: Config.services.gpuType.toUpperCase() || autoGpuType + property string autoGpuType: "NONE" property real gpuPerc property real gpuTemp property real memUsed @@ -141,10 +143,10 @@ Singleton { Process { id: gpuTypeCheck - running: true + running: !Config.services.gpuType command: ["sh", "-c", "if command -v nvidia-smi &>/dev/null && nvidia-smi -L &>/dev/null; then echo NVIDIA; elif ls /sys/class/drm/card*/device/gpu_busy_percent 2>/dev/null | grep -q .; then echo GENERIC; else echo NONE; fi"] stdout: StdioCollector { - onStreamFinished: root.gpuType = text.trim() + onStreamFinished: root.autoGpuType = text.trim() } } -- cgit v1.2.3-freya