add clock
This commit is contained in:
parent
d1e97cad62
commit
c32e27b471
41
config/quickshell/Time.qml
Normal file
41
config/quickshell/Time.qml
Normal file
|
@ -0,0 +1,41 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
|
||||
ListView {
|
||||
id: root
|
||||
|
||||
height: 110
|
||||
width: 60
|
||||
anchors.centerIn: parent
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Minutes
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors.centerIn: parent
|
||||
|
||||
Rectangle {
|
||||
width: 50
|
||||
height: 60
|
||||
anchors.centerIn: parent
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
anchors.centerIn: parent
|
||||
text: {
|
||||
const hours = clock.hours.toString().padStart(2, '0')
|
||||
const minutes = clock.minutes.toString().padStart(2, '0')
|
||||
return `${hours}\n${minutes}`
|
||||
}
|
||||
font.pointSize: 20
|
||||
color: "black"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ ListView {
|
|||
model: workspaceArray
|
||||
anchors.top: parent.top
|
||||
anchors.centerIn: parent
|
||||
height: 500
|
||||
height: 110
|
||||
width: 60
|
||||
spacing: 2
|
||||
delegate: Item {
|
||||
|
|
|
@ -56,27 +56,22 @@ ShellRoot {
|
|||
// Center
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
/* Text { */
|
||||
/* color: "#FFFFFF" */
|
||||
/* // now just time instead of root.time */
|
||||
/* text: time */
|
||||
/* } */
|
||||
Text {
|
||||
color: "#FFFFFF"
|
||||
// now just time instead of root.time
|
||||
text: time
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// right
|
||||
RowLayout {
|
||||
/* anchors.right: parent.right */
|
||||
/* anchors.top: parent.top */
|
||||
anchors.bottom: parent.bottom
|
||||
spacing: 5
|
||||
|
||||
Battery { }
|
||||
|
||||
Text {
|
||||
color: "#FFFFFF"
|
||||
text: "Right"
|
||||
}
|
||||
|
||||
Battery { }
|
||||
Time { }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,7 +79,7 @@ ShellRoot {
|
|||
|
||||
Process {
|
||||
id: dateProc
|
||||
command: ["date"]
|
||||
command: ["date", "+%I:%M%p %A, %b %e, %Y"]
|
||||
running: true
|
||||
|
||||
stdout: SplitParser {
|
||||
|
|
Loading…
Reference in a new issue