mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 09:36:46 +00:00
quickshell and hyprland additions
This commit is contained in:
28
.config/quickshell/caelestia/services/Time.qml
Normal file
28
.config/quickshell/caelestia/services/Time.qml
Normal file
@@ -0,0 +1,28 @@
|
||||
pragma Singleton
|
||||
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
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
|
||||
|
||||
readonly property string timeStr: format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm")
|
||||
readonly property list<string> timeComponents: timeStr.split(":")
|
||||
readonly property string hourStr: timeComponents[0] ?? ""
|
||||
readonly property string minuteStr: timeComponents[1] ?? ""
|
||||
readonly property string amPmStr: timeComponents[2] ?? ""
|
||||
|
||||
function format(fmt: string): string {
|
||||
return Qt.formatDateTime(clock.date, fmt);
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Seconds
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user