summaryrefslogtreecommitdiff
path: root/services/Time.qml
diff options
context:
space:
mode:
Diffstat (limited to 'services/Time.qml')
-rw-r--r--services/Time.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/services/Time.qml b/services/Time.qml
new file mode 100644
index 0000000..c4b3913
--- /dev/null
+++ b/services/Time.qml
@@ -0,0 +1,20 @@
+pragma Singleton
+
+import Quickshell
+
+Singleton {
+ property alias enabled: clock.enabled
+ readonly property date date: clock.date
+ readonly property int hours: clock.hours
+ readonly property int minutes: clock.minutes
+ readonly property int seconds: clock.seconds
+
+ function format(fmt: string): string {
+ return Qt.formatDateTime(clock.date, fmt);
+ }
+
+ SystemClock {
+ id: clock
+ precision: SystemClock.Seconds
+ }
+}