diff --git a/home/common/programs/hyprland/quickshell/Bar.qml b/home/common/programs/hyprland/quickshell/Bar.qml new file mode 100644 index 0000000..820cc10 --- /dev/null +++ b/home/common/programs/hyprland/quickshell/Bar.qml @@ -0,0 +1,28 @@ +import Quickshell +import Quickshell.Io +import QtQuick + +Scope { + Variants { + model: Quickshell.screens; + + delegate: Component { + PanelWindow { + property var modelData + screen: modelData + + anchors { + top: true + left: true + right: true + } + + implicitHeight: 30 + + ClockWidget { + anchors.centerIn: parent + } + } + } + } +} diff --git a/home/common/programs/hyprland/quickshell/ClockWidget.qml b/home/common/programs/hyprland/quickshell/ClockWidget.qml new file mode 100644 index 0000000..10d8c98 --- /dev/null +++ b/home/common/programs/hyprland/quickshell/ClockWidget.qml @@ -0,0 +1,5 @@ +import QtQuick + +Text { + text: Time.time +} diff --git a/home/common/programs/hyprland/quickshell/Time.qml b/home/common/programs/hyprland/quickshell/Time.qml new file mode 100644 index 0000000..d707174 --- /dev/null +++ b/home/common/programs/hyprland/quickshell/Time.qml @@ -0,0 +1,26 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string time + + Process { + id: dateProc + command: ["date"] + running: true + stdout: StdioCollector { + onStreamFinished: root.time = this.text + } + } + + Timer { + interval: 1000 + running: true + repeat: true + onTriggered: dateProc.running = true + } +}