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.Io
|
||||
import QTQuick
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
property string time
|
||||
Time { id: timeSource }
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
@@ -23,25 +20,8 @@ Scope {
|
||||
|
||||
ClockWidget {
|
||||
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