add quickshell
This commit is contained in:
parent
3d48e35de5
commit
10960f620d
32 changed files with 1415 additions and 11 deletions
37
quickshell/GpuMonitor.qml
Normal file
37
quickshell/GpuMonitor.qml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
pragma Singleton
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property int usage: 0
|
||||
property int temp: 0
|
||||
|
||||
Timer {
|
||||
interval: 2000
|
||||
running: true
|
||||
repeat: true
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
_proc.running = false
|
||||
_proc.running = true
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: _proc
|
||||
command: ["nvidia-smi", "--query-gpu=utilization.gpu,temperature.gpu", "--format=csv,noheader,nounits"]
|
||||
stdout: SplitParser {
|
||||
onRead: line => {
|
||||
const parts = line.trim().split(/\s*,\s*/)
|
||||
if (parts.length < 2) return
|
||||
const u = parseInt(parts[0])
|
||||
const t = parseInt(parts[1])
|
||||
if (!isNaN(u)) root.usage = u
|
||||
if (!isNaN(t)) root.temp = t
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue