From 44dde3d034115ac32b8f9e6637656e63c6f2c8e3 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 14:12:01 +0200 Subject: [PATCH 1/3] fix centering --- modules/Bar.qml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/Bar.qml b/modules/Bar.qml index 345184b..d4bd398 100644 --- a/modules/Bar.qml +++ b/modules/Bar.qml @@ -26,15 +26,15 @@ PanelWindow { opacity: M.Theme.barOpacity } - RowLayout { + Item { anchors.fill: parent anchors.leftMargin: 8 anchors.rightMargin: 8 - spacing: 8 // ---- left ---- RowLayout { - Layout.alignment: Qt.AlignLeft + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter spacing: 8 // M.Workspaces {} @@ -42,22 +42,19 @@ PanelWindow { M.WindowTitle { Layout.maximumWidth: 400 } } - Item { Layout.fillWidth: true } - // ---- center ---- RowLayout { - Layout.alignment: Qt.AlignHCenter + anchors.centerIn: parent spacing: 8 M.Clock {} M.Notifications {} } - Item { Layout.fillWidth: true } - // ---- right ---- RowLayout { - Layout.alignment: Qt.AlignRight + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter spacing: 12 M.Mpris {} From bf46b0f27722b715ff7c6eeb94640214781b81f0 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 23:06:58 +0200 Subject: [PATCH 2/3] add more icons and stuff --- modules/Network.qml | 7 +++++-- modules/Notifications.qml | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/Network.qml b/modules/Network.qml index 3950a1d..60c1add 100644 --- a/modules/Network.qml +++ b/modules/Network.qml @@ -13,7 +13,7 @@ Row { Process { id: proc running: true - command: ["sh", "-c", "nmcli -t -f NAME,TYPE,DEVICE connection show --active | head -1"] + command: ["sh", "-c", "line=$(nmcli -t -f NAME,TYPE,DEVICE connection show --active 2>/dev/null | head -1); if [ -n \"$line\" ]; then echo \"$line\"; else dev=$(nmcli -t -f DEVICE,STATE device 2>/dev/null | grep ':connected' | grep -v ':unmanaged\\|:unavailable\\|:disconnected\\|:connecting' | head -1 | cut -d: -f1); if [ -n \"$dev\" ]; then echo \"linked:linked:$dev\"; fi; fi"] stdout: StdioCollector { onStreamFinished: { const line = text.trim(); @@ -26,7 +26,9 @@ Row { const parts = line.split(":"); root.essid = parts[0] || ""; root.ifname = parts[2] || ""; - root.state = (parts[1] || "").includes("wireless") ? "wifi" : "eth"; + if ((parts[1] || "").includes("wireless")) root.state = "wifi"; + else if (parts[0] === "linked") root.state = "linked"; + else root.state = "eth"; } } } @@ -41,6 +43,7 @@ Row { text: { if (root.state === "wifi") return " " + root.essid; if (root.state === "eth") return "󰈀"; + if (root.state === "linked") return "󱘖"; return "󰣽"; } color: M.Theme.base05 diff --git a/modules/Notifications.qml b/modules/Notifications.qml index 2342d1c..85b96f1 100644 --- a/modules/Notifications.qml +++ b/modules/Notifications.qml @@ -8,6 +8,7 @@ Row { property int count: 0 property bool dnd: false + property bool inhibited: false Process { id: sub @@ -18,8 +19,10 @@ Row { onRead: (line) => { try { const d = JSON.parse(line); + const cls = d.class ?? ""; root.count = d.count ?? 0; - root.dnd = (d.class ?? "").includes("dnd"); + root.dnd = cls.includes("dnd"); + root.inhibited = cls.includes("inhibited"); } catch (e) {} } } @@ -27,6 +30,7 @@ Row { Text { text: { + if (root.inhibited) return root.count > 0 ? "󰂛" : "󰪑"; if (root.dnd) return root.count > 0 ? "󰂠" : "󰪓"; return root.count > 0 ? "󱅫" : "󰂜"; } From 3c9f6e78cc8a0af240a5ac7a0ed0cb517f2bbb5a Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 23:09:30 +0200 Subject: [PATCH 3/3] fix clock centering --- modules/Bar.qml | 64 ++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/modules/Bar.qml b/modules/Bar.qml index d4bd398..443e807 100644 --- a/modules/Bar.qml +++ b/modules/Bar.qml @@ -26,25 +26,30 @@ PanelWindow { opacity: M.Theme.barOpacity } - Item { + RowLayout { anchors.fill: parent anchors.leftMargin: 8 anchors.rightMargin: 8 + spacing: 0 // ---- left ---- - RowLayout { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - spacing: 8 + Item { + Layout.fillWidth: true + Layout.fillHeight: true - // M.Workspaces {} - M.Tray { bar: bar } - M.WindowTitle { Layout.maximumWidth: 400 } + RowLayout { + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + spacing: 8 + + // M.Workspaces {} + M.Tray { bar: bar } + M.WindowTitle { Layout.maximumWidth: 400 } + } } // ---- center ---- RowLayout { - anchors.centerIn: parent spacing: 8 M.Clock {} @@ -52,25 +57,30 @@ PanelWindow { } // ---- right ---- - RowLayout { - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - spacing: 12 + Item { + Layout.fillWidth: true + Layout.fillHeight: true - M.Mpris {} - M.Volume {} - M.Bluetooth {} - M.Backlight {} - M.Network {} - M.PowerProfile {} - M.IdleInhibitor {} - M.Weather {} - M.Temperature {} - M.Cpu {} - M.Memory {} - M.Disk {} - M.Battery {} - M.Wlogout {} + RowLayout { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + spacing: 12 + + M.Mpris {} + M.Volume {} + M.Bluetooth {} + M.Backlight {} + M.Network {} + M.PowerProfile {} + M.IdleInhibitor {} + M.Weather {} + M.Temperature {} + M.Cpu {} + M.Memory {} + M.Disk {} + M.Battery {} + M.Wlogout {} + } } } }