From 68f0355940f374ec4dcc168be3f0e123e7635bfb Mon Sep 17 00:00:00 2001 From: ATDMA Date: Sun, 1 Feb 2026 17:06:53 -0500 Subject: [PATCH] refactor(quickshell): simplify workspace ID handling in Workspaces.qml and Lock.qml --- dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml | 3 +-- dots/.config/quickshell/ii/modules/ii/lock/Lock.qml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml index 0728a3e10..36c488730 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml @@ -18,8 +18,7 @@ Item { property bool borderless: Config.options.bar.borderless readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.QsWindow.window?.screen) readonly property Toplevel activeWindow: ToplevelManager.activeToplevel - // Clamp to avoid lock-screen temp workspace (2147483647 - N) leaking into UI - readonly property int effectiveActiveWorkspaceId: Math.max(1, Math.min(100, monitor?.activeWorkspace?.id ?? 1)) + readonly property int effectiveActiveWorkspaceId: monitor?.activeWorkspace?.id ?? 1 readonly property int workspacesShown: Config.options.bar.workspaces.shown readonly property int workspaceGroup: Math.floor((effectiveActiveWorkspaceId - 1) / root.workspacesShown) diff --git a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml index 33927f8b5..1837480ad 100644 --- a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml +++ b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml @@ -23,7 +23,7 @@ LockScreen { for (var j = 0; j < Quickshell.screens.length; ++j) { var monName = Quickshell.screens[j].name var wsId = root.savedWorkspaces[monName] - if (wsId !== undefined && wsId >= 1 && wsId <= 100) { + if (wsId !== undefined) { batch += "dispatch focusmonitor " + monName + "; dispatch workspace " + wsId + "; " } } @@ -49,7 +49,6 @@ LockScreen { var mon = Quickshell.screens[i].name var mData = HyprlandData.monitors.find(m => m.name === mon) var ws = (mData?.activeWorkspace?.id ?? 1) - if (ws < 1 || ws > 100) ws = 1 next[mon] = ws batch += "dispatch focusmonitor " + mon + "; dispatch workspace " + (2147483647 - ws) + "; " }