diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-24 07:36:47 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-24 07:36:47 -0500 |
| commit | 5477bf4a366dd2038b144aa542ce3785f205f368 (patch) | |
| tree | 4297b04984310e6b2f3730e5df8e6f9cca62ab4f /dotfiles | |
| parent | a0e3a6ffadd867153587b77bcf8727fdd34c5f7a (diff) | |
| download | archsetup-5477bf4a366dd2038b144aa542ce3785f205f368.tar.gz archsetup-5477bf4a366dd2038b144aa542ce3785f205f368.zip | |
fix(hyprland): Escape special workspace on navigate
When focus is inside a special workspace (e.g. special:stash),
layoutmsg cyclenext/cycleprev only operates within that workspace,
trapping $mod+J inside the scratchpad overlay.
Detect workspace name starting with "special:" on focus navigation
(not move), toggle the overlay off first, re-read active window
state, then fall through to the normal layout/floating branches.
Add unit tests with a fake hyprctl harness in
tests/layout-navigate/. ```
Diffstat (limited to 'dotfiles')
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/layout-navigate | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/dotfiles/hyprland/.local/bin/layout-navigate b/dotfiles/hyprland/.local/bin/layout-navigate index 352db79..89af45f 100755 --- a/dotfiles/hyprland/.local/bin/layout-navigate +++ b/dotfiles/hyprland/.local/bin/layout-navigate @@ -6,9 +6,27 @@ DIR="$1" MOVE="$2" -FLOATING=$(hyprctl activewindow -j | jq -r '.floating') + +ACTIVE_JSON=$(hyprctl activewindow -j) +FLOATING=$(echo "$ACTIVE_JSON" | jq -r '.floating') +WS_NAME=$(echo "$ACTIVE_JSON" | jq -r '.workspace.name') LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') +# If the active window is in a special workspace (scratchpad overlay) and we +# are navigating focus (not moving), hide the overlay first. layoutmsg/cyclenext +# cannot cross the overlay→regular boundary, so without this the $mod+J key +# gets trapped inside the scratchpad. +case "$WS_NAME" in + special:*) + if [ "$MOVE" != "move" ]; then + hyprctl dispatch togglespecialworkspace "${WS_NAME#special:}" + # Re-read state: focus has moved to the regular workspace. + ACTIVE_JSON=$(hyprctl activewindow -j) + FLOATING=$(echo "$ACTIVE_JSON" | jq -r '.floating') + fi + ;; +esac + # If current window is floating, use cyclenext to reach tiled windows if [ "$FLOATING" = "true" ] && [ "$MOVE" != "move" ]; then if [ "$DIR" = "next" ]; then |
