diff --git a/StatusBar.qml b/StatusBar.qml new file mode 100644 index 0000000..b848f6c --- /dev/null +++ b/StatusBar.qml @@ -0,0 +1,139 @@ +import Quickshell +import Quickshell.Hyprland +import Quickshell.Wayland +import QtQuick +import QtQuick.Controls +import QtQuick.Effects +import QtQuick.Shapes +import "." as Shell + +PanelWindow { + id: root + anchors { + top: true + } + implicitWidth: 1024 + implicitHeight: 1 + WlrLayershell.keyboardFocus: WlrKeyboardFocus.None + WlrLayershell.layer: WlrLayer.Overlay + exclusionMode: ExclusionMode.Ignore + property real radius: 16 + property var bgColor: "#222222" + property int fullHeight: 48 + color: "transparent" + Shape { + id: background + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + width: 1000 + height: 0 + property real radius: 12 + property var color: "white" + preferredRendererType: Shape.CurveRenderer + NumberAnimation on height { + id: entry + running: false + to: fullHeight + duration: 300 + easing.type: Easing.OutBack + easing.overshoot: 1.5 + onStarted: root.implicitHeight = 60 + } + NumberAnimation on height { + id: exit + running: false + to: 0 + duration: 300 + easing.type: Easing.InCubic + onFinished: root.implicitHeight = 1 + } + ShapePath { + strokeWidth: 0 + fillColor: root.bgColor + startX: 0 + startY: 0 + PathArc { + x: root.radius; y: Math.min(root.radius, background.height/2) + radiusX: root.radius; radiusY: y + direction: PathArc.Clockwise + } + PathLine { x: root.radius; y: background.height - Math.min(root.radius, background.height/2) } + PathArc { + x: root.radius * 2; y: background.height + radiusX: root.radius; radiusY: Math.min(root.radius, background.height/2) + direction: PathArc.Counterclockwise + } + PathLine { x: background.width - root.radius * 2; y: background.height } + PathArc { + x: background.width - root.radius; y: background.height - Math.min(root.radius, background.height/2) + radiusX: root.radius; radiusY: Math.min(root.radius, background.height/2) + direction: PathArc.Counterclockwise + } + PathLine { x: background.width - root.radius; y: Math.min(root.radius, background.height/2) } + PathArc { + x: background.width; y: 0 + radiusX: root.radius; radiusY: Math.min(root.radius, background.height/2) + direction: PathArc.Clockwise + } + } + layer.enabled: true + layer.effect: MultiEffect { + shadowEnabled: true + } + } + Row { + anchors { + left: background.left + bottom: background.bottom + leftMargin: root.radius * 2 + } + height: fullHeight + Button { + anchors { + top: parent.top + bottom: parent.bottom + } + width: 20 + background: Image { + anchors.centerIn: parent + width: 20 + height: width + source: Qt.resolvedUrl("./arch.svg") + sourceSize {width: width; height: height} + } + } + } + Shell.Workspaces { + height: fullHeight + anchors { + horizontalCenter: background.horizontalCenter + bottom: background.bottom + } + } + Row { + anchors { + right: background.right + bottom: background.bottom + rightMargin: root.radius * 2 + } + height: fullHeight + Text { + property var clock: SystemClock {} + anchors.verticalCenter: parent.verticalCenter + color: "white" + text: Qt.formatDateTime(clock.date, "ddd MMM dd ยท hh:mm") + } + } + MouseArea { + anchors.fill: background + hoverEnabled: true + onExited: { + entry.stop() + exit.start() + } + } + HoverHandler { onHoveredChanged: if (hovered) { + exit.stop() + entry.start() + }} +} diff --git a/Workspaces.qml b/Workspaces.qml new file mode 100644 index 0000000..fa65f6d --- /dev/null +++ b/Workspaces.qml @@ -0,0 +1,30 @@ +import QtQuick +import QtQuick.Shapes +import Quickshell.Hyprland + +Row { + Repeater { + model: 9 + delegate: Shape { + height: 14 + width: 24 + property var workspace: Hyprland.workspaces.values.find(ws => ws.id === modelData) + preferredRendererType: Shape.CurveRenderer + anchors.verticalCenter: parent.verticalCenter + ShapePath { + strokeWidth: workspace ? 12 : 4 + strokeColor: "white" + fillColor: "transparent" + PathAngleArc { + moveToStart: true + centerX: width/2 + centerY: height/2 + startAngle: 0 + sweepAngle: 360 + radiusX: workspace ? 2 : 6 + radiusY: radiusX + } + } + } + } +} diff --git a/arch.svg b/arch.svg new file mode 100644 index 0000000..ca3bd88 --- /dev/null +++ b/arch.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell.qml b/shell.qml index 1c48d37..1ed9ba4 100644 --- a/shell.qml +++ b/shell.qml @@ -5,6 +5,7 @@ import "." as Shell ShellRoot { Shell.Wall {} Shell.Launcher {} + Shell.StatusBar {} Shell.Boateye {} Shell.Lock { id: lock diff --git a/test.js b/test.js deleted file mode 100644 index b1c6ea4..0000000 --- a/test.js +++ /dev/null @@ -1 +0,0 @@ -export default {}