From bddbfbcc45b9dc7b293b50d98ef94babe0741dcf Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 15 May 2025 06:35:47 +0200 Subject: [PATCH] bar: fix ws click switching --- .config/quickshell/modules/bar/Workspaces.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/quickshell/modules/bar/Workspaces.qml b/.config/quickshell/modules/bar/Workspaces.qml index 2993e41ec..af5336ecf 100644 --- a/.config/quickshell/modules/bar/Workspaces.qml +++ b/.config/quickshell/modules/bar/Workspaces.qml @@ -172,17 +172,17 @@ Item { Button { id: button + property int workspaceValue: workspaceGroup * ConfigOptions.bar.workspaces.shown + index + 1 Layout.fillHeight: true - onPressed: Hyprland.dispatch(`workspace ${index+1}`) + onPressed: Hyprland.dispatch(`workspace ${workspaceValue}`) width: workspaceButtonWidth background: Item { id: workspaceButtonBackground implicitWidth: workspaceButtonWidth implicitHeight: workspaceButtonWidth - property int workspaceValue: workspaceGroup * ConfigOptions.bar.workspaces.shown + index + 1 property var biggestWindow: { - const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == workspaceButtonBackground.workspaceValue) + const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == button.workspaceValue) return windowsInThisWorkspace.reduce((maxWin, win) => { const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0) const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0) @@ -199,9 +199,9 @@ Item { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.pixelSize: Appearance.font.pixelSize.small - ((text.length - 1) * (text !== "10") * 2) - text: `${workspaceButtonBackground.workspaceValue}` + text: `${button.workspaceValue}` elide: Text.ElideRight - color: (monitor.activeWorkspace?.id == workspaceButtonBackground.workspaceValue) ? + color: (monitor.activeWorkspace?.id == button.workspaceValue) ? Appearance.m3colors.m3onPrimary : (workspaceOccupied[index] ? Appearance.colors.colOnLayer1 : Appearance.colors.colOnLayer1Inactive)