aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-24 07:36:47 -0500
committerCraig Jennings <c@cjennings.net>2026-04-24 07:36:47 -0500
commit75936040342088d84304a6a367eb87ed30078967 (patch)
tree9ecfef12c9a567cf4ef2b7fa6a2444af8a7f4c75 /dotfiles
parent9ea97d5fd08b1756823da36a4417f6610927feea (diff)
downloadarchsetup-75936040342088d84304a6a367eb87ed30078967.tar.gz
archsetup-75936040342088d84304a6a367eb87ed30078967.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-xdotfiles/hyprland/.local/bin/layout-navigate20
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