From 92e923262965d77961ea2d9b44874f67626972ae Mon Sep 17 00:00:00 2001 From: lucy Date: Thu, 15 Jan 2026 01:13:17 +0100 Subject: [PATCH] add more modules and show workspace only on monitors they belond --- Colors.qml | 38 +++++++++++------------ modules/Bar/Bar.qml | 63 ++++++++++++++++++++------------------ modules/Bar/Title.qml | 24 +++++++++++++++ modules/Bar/Workspaces.qml | 47 ++++++++++++++++++++++++++++ settings/Settings.qml | 7 +++-- settings/config.json | 7 +++-- 6 files changed, 134 insertions(+), 52 deletions(-) create mode 100644 modules/Bar/Title.qml diff --git a/Colors.qml b/Colors.qml index aba1af7..42dff64 100644 --- a/Colors.qml +++ b/Colors.qml @@ -5,25 +5,25 @@ import Quickshell Singleton { id: customColors // Core Backgrounds - readonly property color background: "#1E1E2E" - readonly property color foreground: "#CDD6F4" - readonly property color cursor: "#CDD6F4" + readonly property color background: "#1D2021" + readonly property color foreground: "#D5C4A1" + readonly property color cursor: "#D5C4A1" // The 16 Colors of the Apocalypse - readonly property color color0: "#45475A" - readonly property color color1: "#F38BA8" - readonly property color color2: "#A6E3A1" - readonly property color color3: "#F9E2AF" - readonly property color color4: "#89B4FA" - readonly property color color5: "#F5C2E7" - readonly property color color6: "#94E2D5" - readonly property color color7: "#BAC2DE" - readonly property color color8: "#585B70" - readonly property color color9: "#F38BA8" - readonly property color color10: "#A6E3A1" - readonly property color color11: "#F9E2AF" - readonly property color color12: "#89B4FA" - readonly property color color13: "#F5C2E7" - readonly property color color14: "#94E2D5" - readonly property color color15: "#A6ADC8" + readonly property color color0: "#1D2021" + readonly property color color1: "#FB4934" + readonly property color color2: "#B8BB26" + readonly property color color3: "#FABD2F" + readonly property color color4: "#83A598" + readonly property color color5: "#D3869B" + readonly property color color6: "#8EC07C" + readonly property color color7: "#D5C4A1" + readonly property color color8: "#665C54" + readonly property color color9: "#FB4934" + readonly property color color10: "#B8BB26" + readonly property color color11: "#FABD2F" + readonly property color color12: "#83A598" + readonly property color color13: "#D3869B" + readonly property color color14: "#8EC07C" + readonly property color color15: "#FBF1C7" } diff --git a/modules/Bar/Bar.qml b/modules/Bar/Bar.qml index 0fa8552..087c2b2 100644 --- a/modules/Bar/Bar.qml +++ b/modules/Bar/Bar.qml @@ -5,38 +5,43 @@ import "../../" import "../../reusables/" import QtQuick.Layouts -PanelWindow { - id: root - color: Colors.background - anchors { - top: true - left: true - right: true - } - implicitHeight: Settings.config.barHeight - Row { - id: leftStuff - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - CustomText { - text: "workspaces here" +Variants { + model: Quickshell.screens + delegate: PanelWindow { + id: root + required property var modelData + screen: modelData + color: Colors.background + anchors { + top: true + left: true + right: true } - } - - Row { - id: centerStuff - anchors.centerIn: parent - CustomText { - text: "windowtitle here" + implicitHeight: Settings.config.barHeight + Row { + id: leftStuff + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + Workspaces { + screen: root.screen + } } - } - Row { - id: rightStuff - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - CustomText { - text: "status shit goes here" + Row { + id: centerStuff + anchors.centerIn: parent + Title { + anchors.verticalCenter: parent.verticalCenter + } + } + + Row { + id: rightStuff + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + CustomText { + text: "status shit goes here" + } } } } diff --git a/modules/Bar/Title.qml b/modules/Bar/Title.qml new file mode 100644 index 0000000..1c01ca7 --- /dev/null +++ b/modules/Bar/Title.qml @@ -0,0 +1,24 @@ +import Quickshell +import QtQuick +import "../../reusables/" +import "../../settings/" +import "../../" +import Quickshell.Hyprland + +Item { + id: root + implicitHeight: Settings.config.barHeight + implicitWidth: textContainer.implicitWidth + Rectangle { + id: textContainer + color: Colors.foreground + implicitWidth: text.implicitWidth + 10 + implicitHeight: Settings.config.barHeight + CustomText { + id: text + color: Colors.background + anchors.centerIn: textContainer + text: Hyprland.activeToplevel.activated ? Hyprland.activeToplevel.title : "sigma" + } + } +} diff --git a/modules/Bar/Workspaces.qml b/modules/Bar/Workspaces.qml index e69de29..fc97766 100644 --- a/modules/Bar/Workspaces.qml +++ b/modules/Bar/Workspaces.qml @@ -0,0 +1,47 @@ +pragma ComponentBehavior: Bound +import "../../reusables/" +import Quickshell.Hyprland +import Quickshell +import QtQuick +import "../../" +import "../../settings/" + +Item { + id: root + implicitWidth: workspaceRow.implicitWidth + height: 30 + required property var screen + Row { + id: workspaceRow + anchors.centerIn: parent + spacing: 0 // Slightly increase spacing between workspace buttons + + Repeater { + id: wsRepeater + model: Hyprland.workspaces + anchors.centerIn: parent + Rectangle { + id: workspaceNumber + property bool isOnMon: modelData.monitor == Hyprland.monitorFor(root.screen) + required property var modelData + width: isOnMon ? Settings.config.barHeight + 10 : 0 + height: isOnMon ? Settings.config.barHeight : 0 + color: modelData.active ? Colors.foreground : "transparent" + + CustomText { + anchors.centerIn: workspaceNumber + text: parent.modelData.id + color: parent.modelData.active ? Colors.background : Colors.foreground // Set contrasting color for workspace number + } + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + cursorShape: Qt.PointingHandCursor + onClicked: { + parent.modelData.activate(); + } + } + } + } + } +} diff --git a/settings/Settings.qml b/settings/Settings.qml index d0c9588..9b398f7 100644 --- a/settings/Settings.qml +++ b/settings/Settings.qml @@ -21,11 +21,14 @@ Singleton { adapter: JsonAdapter { id: settingsAdapter - property var barHeight: 28 + property var barHeight: 18 property var font: "JetBrainsMono Nerd Font" - property var fontSize: 14 + property var fontSize: 12 property var rounding: 10 property var wallDir: "/home/lucy/.walls" + property bool floating: true + property int paddingTop: 10 + property int paddingSides: 10 } } } diff --git a/settings/config.json b/settings/config.json index 4cd70c0..ffecfc6 100644 --- a/settings/config.json +++ b/settings/config.json @@ -1,7 +1,10 @@ { - "barHeight": 28, + "barHeight": 18, + "floating": true, "font": "JetBrainsMono Nerd Font", - "fontSize": 14, + "fontSize": 12, + "paddingSides": 10, + "paddingTop": 10, "rounding": 10, "wallDir": "/home/lucy/.walls" }