nixos/config/quickshell/shell.qml

85 lines
1.2 KiB
QML
Raw Normal View History

2025-01-07 22:37:12 +04:00
import Quickshell
import Quickshell.Io
2025-01-08 11:17:54 +04:00
import Quickshell.Hyprland
2025-01-07 22:37:12 +04:00
import QtQuick
2025-01-08 11:17:54 +04:00
import QtQuick.Layouts
2025-01-07 22:37:12 +04:00
ShellRoot {
ReloadPopup {}
property string time;
Variants {
model: Quickshell.screens
PanelWindow {
property var modelData
screen: modelData
anchors {
2025-01-08 11:17:54 +04:00
top: true;
left: true;
right: true;
2025-01-07 22:37:12 +04:00
}
2025-01-08 11:17:54 +04:00
height: 30;
2025-01-08 08:29:37 +04:00
2025-01-08 11:17:54 +04:00
// left
RowLayout {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 5
2025-01-07 22:37:12 +04:00
2025-01-08 11:17:54 +04:00
Workspaces {}
2025-01-07 22:37:12 +04:00
2025-01-08 11:17:54 +04:00
Text {
text: "Left side"
}
}
// Center
RowLayout {
anchors.centerIn: parent
Text {
2025-01-07 22:37:12 +04:00
// now just time instead of root.time
2025-01-08 11:17:54 +04:00
text: time
}
}
// right
RowLayout {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: 5
Text {
text: "Right side"
}
}
2025-01-07 22:37:12 +04:00
}
}
Process {
id: dateProc
command: ["date"]
running: true
stdout: SplitParser {
// now just time instead of root.time
onRead: data => time = data
}
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}