aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
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