nichts/modules/styling/quickshell/bar/time/Time.qml
2024-08-09 11:54:07 +02:00

28 lines
468 B
QML

// with this line our type becomes a singleton
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
// your singletons should always have Singleton as the type
Singleton {
property string time
Process {
id: dateProc
command: ["date"]
running: true
stdout: SplitParser {
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}