diff --git a/README.md b/README.md index 736ef58..52a79f5 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ What it does: - Ships as a Nix flake package, overlay, Home Manager module, and NixOS module. - Uses the Quickshell IPC target `overview` and layer-shell namespace `overzicht`. +A Hyprland release with Lua dispatcher support (`hl.dsp`) is required. + What I removed from upstream: - Matugen and Caelestia color-source handling. diff --git a/modules/overview/Overview.qml b/modules/overview/Overview.qml index d5d9aff..42da659 100644 --- a/modules/overview/Overview.qml +++ b/modules/overview/Overview.qml @@ -184,10 +184,7 @@ Scope { if (targetId !== null) { const clampedTarget = Math.max(minWorkspaceId, Math.min(maxWorkspaceId, targetId)); - if (Hyprland.usingLua) - Hyprland.dispatch(`hl.dsp.focus({workspace = '${clampedTarget}'})`); - else - Hyprland.dispatch("workspace " + clampedTarget); + Hyprland.dispatch(`hl.dsp.focus({workspace = '${clampedTarget}'})`); event.accepted = true; } } diff --git a/modules/overview/OverviewWidget.qml b/modules/overview/OverviewWidget.qml index d4e1bd2..9727ff7 100644 --- a/modules/overview/OverviewWidget.qml +++ b/modules/overview/OverviewWidget.qml @@ -262,10 +262,7 @@ Item { onClicked: { if (root.draggingTargetWorkspace === -1) { GlobalStates.overviewOpen = false; - if (Hyprland.usingLua) - Hyprland.dispatch(`hl.dsp.focus({workspace = '${workspaceValue}'})`); - else - Hyprland.dispatch(`workspace ${workspaceValue}`); + Hyprland.dispatch(`hl.dsp.focus({workspace = '${workspaceValue}'})`); } } } @@ -392,15 +389,11 @@ Item { root.draggingTargetWorkspace = -1; if (targetWorkspace !== -1) { const changingWorkspace = targetWorkspace !== windowData?.workspace.id; - if (Hyprland.usingLua) { - if (changingWorkspace) - Hyprland.dispatch(`hl.dsp.window.move({workspace = '${targetWorkspace}', follow = false, window = 'address:${address}'})`); - if (swapTarget) { - Hyprland.dispatch(`hl.dsp.window.swap({target = 'address:${swapTarget}', window = 'address:${address}'})`); - Hyprland.dispatch(`hl.dsp.cursor.move({x = ${Math.round(cursorPosition.x)}, y = ${Math.round(cursorPosition.y)}})`); - } - } else if (changingWorkspace) { - Hyprland.dispatch(`movetoworkspacesilent ${targetWorkspace}, address:${address}`); + if (changingWorkspace) + Hyprland.dispatch(`hl.dsp.window.move({workspace = '${targetWorkspace}', follow = false, window = 'address:${address}'})`); + if (swapTarget) { + Hyprland.dispatch(`hl.dsp.window.swap({target = 'address:${swapTarget}', window = 'address:${address}'})`); + Hyprland.dispatch(`hl.dsp.cursor.move({x = ${Math.round(cursorPosition.x)}, y = ${Math.round(cursorPosition.y)}})`); } if (changingWorkspace || swapTarget) { @@ -422,16 +415,10 @@ Item { if (event.button === Qt.LeftButton) { GlobalStates.overviewOpen = false; - if (Hyprland.usingLua) - Hyprland.dispatch(`hl.dsp.focus({ window = 'address:${windowData.address}' })`); - else - Hyprland.dispatch(`focuswindow address:${windowData.address}`); + Hyprland.dispatch(`hl.dsp.focus({window = 'address:${windowData.address}'})`); event.accepted = true; } else if (event.button === Qt.MiddleButton) { - if (Hyprland.usingLua) - Hyprland.dispatch(`hl.dsp.window.close('address:${windowData.address}')`); - else - Hyprland.dispatch(`closewindow address:${windowData.address}`); + Hyprland.dispatch(`hl.dsp.window.close('address:${windowData.address}')`); event.accepted = true; } }