From ac9277952bc8e949d3b92de05063d2ff3db9fde1 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 9 Apr 2026 01:17:15 -0500 Subject: fix(hyprland): escape floating window focus trap in layout-navigate layoutmsg cyclenext only operates on tiled windows, so $mod+J was a no-op when focus was on a floating/pinned scratchpad. Detect floating state and use cyclenext dispatcher instead. --- dotfiles/hyprland/.local/bin/layout-navigate | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'dotfiles') diff --git a/dotfiles/hyprland/.local/bin/layout-navigate b/dotfiles/hyprland/.local/bin/layout-navigate index 07f748a..352db79 100755 --- a/dotfiles/hyprland/.local/bin/layout-navigate +++ b/dotfiles/hyprland/.local/bin/layout-navigate @@ -6,8 +6,19 @@ DIR="$1" MOVE="$2" +FLOATING=$(hyprctl activewindow -j | jq -r '.floating') LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') +# If current window is floating, use cyclenext to reach tiled windows +if [ "$FLOATING" = "true" ] && [ "$MOVE" != "move" ]; then + if [ "$DIR" = "next" ]; then + hyprctl dispatch cyclenext tiled + else + hyprctl dispatch cyclenext prev tiled + fi + exit 0 +fi + case "$LAYOUT" in scrolling) # J (next) goes left, K (prev) goes right -- cgit v1.2.3