added adaptive quickshell
This commit is contained in:
1 parent
6eb56d2065
commit
5b33a73fd8
189 files changed
+8678
-15
No files matched your search
@@ -0,0 +1,28 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
property var details: ({})
|
||||
property string error: ""
|
||||
property bool busy: false
|
||||
function refresh() {
|
||||
if (busy) return;
|
||||
busy = true;
|
||||
probe.running = true;
|
||||
}
|
||||
Process {
|
||||
id: probe
|
||||
command: ["python3", Qt.resolvedUrl("../backend/system_info.py").toString().replace(/^file:\/\//, "")]
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
try { root.details = JSON.parse(text); root.error = ""; }
|
||||
catch (e) { root.error = "Не удалось получить сведения о системе: " + String(e); }
|
||||
}
|
||||
}
|
||||
onExited: root.busy = false
|
||||
}
|
||||
Timer { interval: 60000; repeat: true; running: true; triggeredOnStart: true; onTriggered: root.refresh() }
|
||||
}
|
||||
Reference in new issue
Block a user