diff options
Diffstat (limited to 'desktop/modules/perf/Perf.qml')
| -rw-r--r-- | desktop/modules/perf/Perf.qml | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/desktop/modules/perf/Perf.qml b/desktop/modules/perf/Perf.qml index 5fcf0ab..33b5cbc 100644 --- a/desktop/modules/perf/Perf.qml +++ b/desktop/modules/perf/Perf.qml @@ -56,6 +56,9 @@ Singleton { property var temps: [] // [{label, value, warn, crit}], value null if unread property var disks: [] // Perf.js df rows property var vram: null // bytes + property var gpu: null // gpuSample, the last scan + property var gpuRender: null // percent, rcs + property var gpuCompute: null // percent, ccs property var fan: null // rpm property var rx: [] // bytes/s, newest last property var tx: [] @@ -181,18 +184,27 @@ Singleton { root.temps = t; if (fanView.path) { fanView.reload(); root.fan = root.num(fanView); } - if (!vramProc.running) vramProc.running = true; + if (!gpuProc.running) gpuProc.running = true; } } // ponytail: a shell glob over every fd on the system, ~14ms every 2s, // always; gate it on the panel again if that shows up. Only the user's own processes are readable, so a // system service's GPU use is not counted, as in conky. - // Summed in vram.sh, so JS gets one number, never the scan itself. + // Summed in gpu.sh, so JS gets five numbers, never the scan itself. Process { - id: vramProc - command: ["sh", `${Quickshell.shellDir}/modules/perf/vram.sh`] - stdout: StdioCollector { onStreamFinished: root.vram = text.trim() === "" ? null : Number(text) } + id: gpuProc + command: ["sh", `${Quickshell.shellDir}/modules/perf/gpu.sh`] + stdout: StdioCollector { + onStreamFinished: { + const cur = P.gpuSample(text); + const l = P.gpuLoad(root.gpu, cur); + root.vram = cur ? cur[0] : null; + root.gpuRender = l.render; + root.gpuCompute = l.compute; + root.gpu = cur; + } + } } // --- network ------------------------------------------------------------ |
