nichts/modules/styling/quickshell/bar/Bar.qml

51 lines
966 B
QML
Raw Normal View History

2024-08-01 01:18:12 +02:00
import Quickshell // for ShellRoot and PanelWindow
import Quickshell.Io // For Processes
import QtQuick // For Text
Scope {
2024-08-01 02:23:54 +02:00
id: root
property string time;
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
Variants {
model: Quickshell.screens
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
PanelWindow {
property var modelData
screen: modelData
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
anchors {
top: true
left: true
right: true
}
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
height: 30
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
Text {
anchors.centerIn: parent
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
// now just time instead of root.time
text: time
}
}
2024-08-01 01:18:12 +02:00
}
2024-08-01 02:23:54 +02:00
Process {
id: dateProc
command: ["date"]
running: true
2024-08-01 01:18:12 +02:00
2024-08-01 02:23:54 +02:00
stdout: SplitParser {
// now just time instead of root.time
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
2024-08-01 01:18:12 +02:00
}
}