Files
quickshell/modules/bar/widgets/Clock.qml
T

36 lines
768 B
QML

import QtQuick
import Quickshell
import Quickshell.Hyprland
Rectangle { //workspace
width: timeDisplay.width + 16
height: timeDisplay.height + 16
radius: 4
color: "#333333"
border.color: "#555555"
border.width: 2
Text {
id: timeDisplay
property string currentTime: ""
text: currentTime
color: "#ffffff"
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")
}
}
}
}