diff options
Diffstat (limited to 'services/SystemUsage.qml')
| -rw-r--r-- | services/SystemUsage.qml | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml index 0eed3ef..4d80dc9 100644 --- a/services/SystemUsage.qml +++ b/services/SystemUsage.qml @@ -22,6 +22,8 @@ Singleton { property real lastCpuIdle property real lastCpuTotal + property int refCount + function formatKib(kib: real): var { const mib = 1024; const gib = 1024 ** 2; @@ -49,9 +51,10 @@ Singleton { } Timer { - running: true + running: root.refCount interval: 3000 repeat: true + triggeredOnStart: true onTriggered: { stat.reload(); meminfo.reload(); @@ -96,7 +99,6 @@ Singleton { Process { id: storage - running: true command: ["sh", "-c", "df | grep '^/dev/' | awk '{print $1, $3, $4}'"] stdout: StdioCollector { onStreamFinished: { @@ -142,17 +144,13 @@ Singleton { running: true command: ["sh", "-c", "if ls /sys/class/drm/card*/device/gpu_busy_percent 2>/dev/null | grep -q .; then echo GENERIC; elif command -v nvidia-smi >/dev/null; then echo NVIDIA; else echo NONE; fi"] stdout: StdioCollector { - onStreamFinished: { - root.gpuType = text.trim(); - gpuUsage.running = true; - } + onStreamFinished: root.gpuType = text.trim() } } Process { id: gpuUsage - running: true command: root.gpuType === "GENERIC" ? ["sh", "-c", "cat /sys/class/drm/card*/device/gpu_busy_percent"] : root.gpuType === "NVIDIA" ? ["nvidia-smi", "--query-gpu=utilization.gpu,temperature.gpu", "--format=csv,noheader,nounits"] : ["echo"] stdout: StdioCollector { onStreamFinished: { @@ -175,7 +173,6 @@ Singleton { Process { id: sensors - running: true command: ["sensors"] environment: ({ LANG: "C", |