Files
dotfiles/quickshell/services/SystemInfo.qml
T
2026-11-17 18:15:16 +07:00

29 lines
890 B
QML

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() }
}