diff --git a/dots/.config/fish/config.fish b/dots/.config/fish/config.fish index 72476660f..0d26fe1dc 100755 --- a/dots/.config/fish/config.fish +++ b/dots/.config/fish/config.fish @@ -18,9 +18,11 @@ if status is-interactive # Commands to run in interactive sessions can go here end # Aliases - alias pamcan pacman + alias clear "printf '\033[2J\033[3J\033[1;1H'" # fix: kitty doesn't clear properly + alias celar "printf '\033[2J\033[3J\033[1;1H'" + alias claer "printf '\033[2J\033[3J\033[1;1H'" alias ls 'eza --icons' - alias clear "printf '\033[2J\033[3J\033[1;1H'" + alias pamcan pacman alias q 'qs -c ii' end diff --git a/dots/.config/quickshell/ii/modules/common/widgets/shapes b/dots/.config/quickshell/ii/modules/common/widgets/shapes index 7f0f0709e..b62e4482a 160000 --- a/dots/.config/quickshell/ii/modules/common/widgets/shapes +++ b/dots/.config/quickshell/ii/modules/common/widgets/shapes @@ -1 +1 @@ -Subproject commit 7f0f0709ec5bbe4c3158c7f5fc68fd890af46618 +Subproject commit b62e4482af56722840dd4b86c4dab41d5c9f2dda diff --git a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml index f0a61ef23..36c488730 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml @@ -18,9 +18,10 @@ Item { property bool borderless: Config.options.bar.borderless readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.QsWindow.window?.screen) readonly property Toplevel activeWindow: ToplevelManager.activeToplevel + readonly property int effectiveActiveWorkspaceId: monitor?.activeWorkspace?.id ?? 1 readonly property int workspacesShown: Config.options.bar.workspaces.shown - readonly property int workspaceGroup: Math.floor((monitor?.activeWorkspace?.id - 1) / root.workspacesShown) + readonly property int workspaceGroup: Math.floor((effectiveActiveWorkspaceId - 1) / root.workspacesShown) property list workspaceOccupied: [] property int widgetPadding: 4 property int workspaceButtonWidth: 26 @@ -29,7 +30,7 @@ Item { property real workspaceIconSizeShrinked: workspaceButtonWidth * 0.55 property real workspaceIconOpacityShrinked: 1 property real workspaceIconMarginShrinked: -4 - property int workspaceIndexInGroup: (monitor?.activeWorkspace?.id - 1) % root.workspacesShown + property int workspaceIndexInGroup: (effectiveActiveWorkspaceId - 1) % root.workspacesShown property bool showNumbers: false Timer { @@ -122,8 +123,8 @@ Item { implicitWidth: workspaceButtonWidth implicitHeight: workspaceButtonWidth radius: (width / 2) - property var previousOccupied: (workspaceOccupied[index-1] && !(!activeWindow?.activated && monitor?.activeWorkspace?.id === index)) - property var rightOccupied: (workspaceOccupied[index+1] && !(!activeWindow?.activated && monitor?.activeWorkspace?.id === index+2)) + property var previousOccupied: (workspaceOccupied[index-1] && !(!activeWindow?.activated && root.effectiveActiveWorkspaceId === index)) + property var rightOccupied: (workspaceOccupied[index+1] && !(!activeWindow?.activated && root.effectiveActiveWorkspaceId === index+2)) property var radiusPrev: previousOccupied ? 0 : (width / 2) property var radiusNext: rightOccupied ? 0 : (width / 2) @@ -133,7 +134,7 @@ Item { bottomRightRadius: radiusNext color: ColorUtils.transparentize(Appearance.m3colors.m3secondaryContainer, 0.4) - opacity: (workspaceOccupied[index] && !(!activeWindow?.activated && monitor?.activeWorkspace?.id === index+1)) ? 1 : 0 + opacity: (workspaceOccupied[index] && !(!activeWindow?.activated && root.effectiveActiveWorkspaceId === index+1)) ? 1 : 0 Behavior on opacity { animation: Appearance.animation.elementMove.numberAnimation.createObject(this) @@ -225,7 +226,7 @@ Item { } text: Config.options?.bar.workspaces.numberMap[button.workspaceValue - 1] || button.workspaceValue elide: Text.ElideRight - color: (monitor?.activeWorkspace?.id == button.workspaceValue) ? + color: (root.effectiveActiveWorkspaceId == button.workspaceValue) ? Appearance.m3colors.m3onPrimary : (workspaceOccupied[index] ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer1Inactive) @@ -245,7 +246,7 @@ Item { width: workspaceButtonWidth * 0.18 height: width radius: width / 2 - color: (monitor?.activeWorkspace?.id == button.workspaceValue) ? + color: (root.effectiveActiveWorkspaceId == button.workspaceValue) ? Appearance.m3colors.m3onPrimary : (workspaceOccupied[index] ? Appearance.m3colors.m3onSecondaryContainer : Appearance.colors.colOnLayer1Inactive) diff --git a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml index 7cbd68030..1837480ad 100644 --- a/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml +++ b/dots/.config/quickshell/ii/modules/ii/lock/Lock.qml @@ -11,11 +11,56 @@ import Quickshell.Hyprland LockScreen { id: root + // Monitor name -> workspace id to restore on unlock (set when locking) + property var savedWorkspaces: ({}) + + Timer { + id: restoreTimer + interval: 150 + repeat: false + onTriggered: { + var batch = "" + for (var j = 0; j < Quickshell.screens.length; ++j) { + var monName = Quickshell.screens[j].name + var wsId = root.savedWorkspaces[monName] + if (wsId !== undefined) { + batch += "dispatch focusmonitor " + monName + "; dispatch workspace " + wsId + "; " + } + } + if (batch.length > 0) { + Quickshell.execDetached(["hyprctl", "--batch", batch + "reload"]) + } + } + } + lockSurface: LockSurface { context: root.context } - // Push everything down + // Single batch for lock and unlock so we don't race multiple hyprctl calls + Connections { + target: GlobalStates + function onScreenLockedChanged() { + if (GlobalStates.screenLocked) { + // Lock: save workspace per monitor and move all to temp workspace in one batch + var next = {} + var batch = "keyword animation workspaces,1,7,menu_decel,slidevert; " + for (var i = 0; i < Quickshell.screens.length; ++i) { + var mon = Quickshell.screens[i].name + var mData = HyprlandData.monitors.find(m => m.name === mon) + var ws = (mData?.activeWorkspace?.id ?? 1) + next[mon] = ws + batch += "dispatch focusmonitor " + mon + "; dispatch workspace " + (2147483647 - ws) + "; " + } + root.savedWorkspaces = next + Quickshell.execDetached(["hyprctl", "--batch", batch + "reload"]) + } else { + restoreTimer.start() + } + } + } + + // Push everything down (visual only; workspace switch is in Connections above) Variants { model: Quickshell.screens delegate: Scope { @@ -24,18 +69,6 @@ LockScreen { property string targetMonitorName: modelData.name property int verticalMovementDistance: modelData.height property int horizontalSqueeze: modelData.width * 0.2 - property int lastWorkspaceId - onShouldPushChanged: { - if (shouldPush) { - // Save workspace - print(targetMonitorName) - lastWorkspaceId = HyprlandData.monitors.find(m => m.name == targetMonitorName).activeWorkspace.id - // Set anim to vertical and move to very very big workspace for a sliding up effect - Quickshell.execDetached(["hyprctl", "--batch", `keyword animation workspaces,1,7,menu_decel,slidevert; dispatch workspace ${2147483647 - lastWorkspaceId}`]); - } else { - Quickshell.execDetached(["hyprctl", "--batch", `dispatch workspace ${lastWorkspaceId}; reload`]); - } - } } } } diff --git a/dots/.config/quickshell/ii/modules/ii/overview/Overview.qml b/dots/.config/quickshell/ii/modules/ii/overview/Overview.qml index d94404721..fe3df64a3 100644 --- a/dots/.config/quickshell/ii/modules/ii/overview/Overview.qml +++ b/dots/.config/quickshell/ii/modules/ii/overview/Overview.qml @@ -24,7 +24,7 @@ Scope { WlrLayershell.namespace: "quickshell:overview" WlrLayershell.layer: WlrLayer.Top - // WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" mask: Region { diff --git a/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml b/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml index f2a600c6d..96d72d9d1 100644 --- a/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml +++ b/dots/.config/quickshell/ii/modules/ii/overview/OverviewWidget.qml @@ -16,8 +16,10 @@ Item { required property var screen readonly property HyprlandMonitor monitor: Hyprland.monitorFor(screen) readonly property var toplevels: ToplevelManager.toplevels + // 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 workspacesShown: Config.options.overview.rows * Config.options.overview.columns - readonly property int workspaceGroup: Math.floor((monitor.activeWorkspace?.id - 1) / workspacesShown) + readonly property int workspaceGroup: Math.floor((effectiveActiveWorkspaceId - 1) / workspacesShown) property bool monitorIsFocused: (Hyprland.focusedMonitor?.name == monitor.name) property var windows: HyprlandData.windowList property var windowByAddress: HyprlandData.windowByAddress @@ -301,8 +303,8 @@ Item { Rectangle { // Focused workspace indicator id: focusedWorkspaceIndicator - property int rowIndex: getWsRow(monitor.activeWorkspace?.id) - property int colIndex: getWsColumn(monitor.activeWorkspace?.id) + property int rowIndex: getWsRow(root.effectiveActiveWorkspaceId) + property int colIndex: getWsColumn(root.effectiveActiveWorkspaceId) x: (root.workspaceImplicitWidth + workspaceSpacing) * colIndex y: (root.workspaceImplicitHeight + workspaceSpacing) * rowIndex z: root.windowZ diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/SidebarRight.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/SidebarRight.qml index 62946cb61..e7da61e44 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/SidebarRight.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/SidebarRight.qml @@ -22,8 +22,7 @@ Scope { exclusiveZone: 0 implicitWidth: sidebarWidth WlrLayershell.namespace: "quickshell:sidebarRight" - // Hyprland 0.49: Focus is always exclusive and setting this breaks mouse focus grab - // WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + WlrLayershell.keyboardFocus: GlobalStates.sidebarRightOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" anchors { diff --git a/dots/.config/quickshell/ii/modules/ii/wallpaperSelector/WallpaperSelector.qml b/dots/.config/quickshell/ii/modules/ii/wallpaperSelector/WallpaperSelector.qml index 5bd79b56b..9d9ba9008 100644 --- a/dots/.config/quickshell/ii/modules/ii/wallpaperSelector/WallpaperSelector.qml +++ b/dots/.config/quickshell/ii/modules/ii/wallpaperSelector/WallpaperSelector.qml @@ -25,6 +25,7 @@ Scope { exclusionMode: ExclusionMode.Ignore WlrLayershell.namespace: "quickshell:wallpaperSelector" WlrLayershell.layer: WlrLayer.Overlay + WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand color: "transparent" anchors.top: true diff --git a/dots/.config/quickshell/ii/services/Ai.qml b/dots/.config/quickshell/ii/services/Ai.qml index 580b3cfdb..a273415f5 100644 --- a/dots/.config/quickshell/ii/services/Ai.qml +++ b/dots/.config/quickshell/ii/services/Ai.qml @@ -294,18 +294,6 @@ Singleton { "key_get_description": Translation.tr("**Instructions**: Log into Mistral account, go to Keys on the sidebar, click Create new key"), "api_format": "mistral", }), - "openrouter-deepseek-r1": aiModelComponent.createObject(this, { - "name": "DeepSeek R1", - "icon": "deepseek-symbolic", - "description": Translation.tr("Online via %1 | %2's model").arg("OpenRouter").arg("DeepSeek"), - "homepage": "https://openrouter.ai/deepseek/deepseek-r1:free", - "endpoint": "https://openrouter.ai/api/v1/chat/completions", - "model": "deepseek/deepseek-r1:free", - "requires_key": true, - "key_id": "openrouter", - "key_get_link": "https://openrouter.ai/settings/keys", - "key_get_description": Translation.tr("**Pricing**: free. Data use policy varies depending on your OpenRouter account settings.\n\n**Instructions**: Log into OpenRouter account, go to Keys on the topright menu, click Create API Key"), - }), } property var modelList: Object.keys(root.models) property var currentModelId: Persistent.states?.ai?.model || modelList[0] diff --git a/dots/.config/quickshell/ii/services/GlobalFocusGrab.qml b/dots/.config/quickshell/ii/services/GlobalFocusGrab.qml index 547d79e17..6385d3df7 100644 --- a/dots/.config/quickshell/ii/services/GlobalFocusGrab.qml +++ b/dots/.config/quickshell/ii/services/GlobalFocusGrab.qml @@ -52,9 +52,17 @@ Singleton { } } + function hasActive(element) { + return element?.activeFocus || Array.from( + element?.children + ).some( + (child) => hasActive(child) + ); + } + HyprlandFocusGrab { id: grab - windows: [...root.persistent, ...root.dismissable] + windows: root.dismissable.every(w => !w?.focusable) || root.dismissable.some(w => hasActive(w?.contentItem)) ? [...root.dismissable, ...root.persistent] : [...root.dismissable] active: root.dismissable.length > 0 onCleared: () => { root.dismiss(); diff --git a/dots/.config/quickshell/ii/services/HyprlandData.qml b/dots/.config/quickshell/ii/services/HyprlandData.qml index 5ec7bd68d..5dfedab6a 100644 --- a/dots/.config/quickshell/ii/services/HyprlandData.qml +++ b/dots/.config/quickshell/ii/services/HyprlandData.qml @@ -139,7 +139,9 @@ Singleton { stdout: StdioCollector { id: workspacesCollector onStreamFinished: { - root.workspaces = JSON.parse(workspacesCollector.text); + var rawWorkspaces = JSON.parse(workspacesCollector.text); + // Filter out invalid workspace ids (e.g. lock-screen temp workspace 2147483647 - N) + root.workspaces = rawWorkspaces.filter(ws => ws.id >= 1 && ws.id <= 100); let tempWorkspaceById = {}; for (var i = 0; i < root.workspaces.length; ++i) { var ws = root.workspaces[i];