Update dotfiles (2026-01-19 19:48:47)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// Bar.qml
|
||||
import Quickshell
|
||||
import qs.Widgets
|
||||
|
||||
Scope {
|
||||
// no more time object
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
implicitHeight: 30
|
||||
|
||||
Clock {
|
||||
anchors.centerIn: parent
|
||||
|
||||
// no more time binding
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// ClockWidget.qml
|
||||
import QtQuick
|
||||
|
||||
Text {
|
||||
// we no longer need time as an input
|
||||
|
||||
// directly access the time property from the Time singleton
|
||||
text: Time.time
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Time.qml
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
// an expression can be broken across multiple lines using {}
|
||||
readonly property string time: {
|
||||
// The passed format string matches the default output of
|
||||
// the `date` command.
|
||||
Qt.formatDateTime(clock.date, "ddd MMM d hh:mm:ss AP t yyyy")
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Seconds
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user