Move clock logic to Time.qml

This commit is contained in:
2025-11-10 14:00:04 +01:00
parent b154ccc549
commit 07e21399d0

View File

@@ -1,10 +1,7 @@
import Quickshell import Quickshell
import Quickshell.Io
import QTQuick
Scope { Scope {
id: root Time { id: timeSource }
property string time
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
@@ -23,25 +20,8 @@ Scope {
ClockWidget { ClockWidget {
anchors.centerIn: parent anchors.centerIn: parent
text: root.time time: timeSource.time
} }
} }
} }
Process {
id: dateProc
command: ["date"]
running: true
stdout StdioCollector {
onStreamFinished: root.time = this.text
}
}
Timer {
intervall: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
} }