Move clock logic to Time.qml
This commit is contained in:
24
user/Bar.qml
24
user/Bar.qml
@@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user