Files
quickshell/modules/bar/widgets/Clock.qml
T
2026-02-16 23:44:27 +01:00

37 lines
832 B
QML

import QtQuick
import Quickshell
import Quickshell.Hyprland
import "../../../colors"
Rectangle { //workspace
width: timeDisplay.width + 16
height: timeDisplay.height + 16
radius: 4
color: Colors.tertiaryContainer
border.color: Colors.tertiaryContainer_fg
border.width: 2
Text {
id: timeDisplay
property string currentTime: ""
text: currentTime
color: Colors.tertiary
font.pixelSize: 18
font.family: "Inter, sans-serif"
anchors.centerIn: parent
//Update time every second
Timer {
interval: 1000
running: true
repeat: true
onTriggered: {
var now = new Date()
timeDisplay.currentTime = Qt.formatTime(now, "hh:mm:ss")
}
}
}
}