summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/hyprland/.local/bin')
-rwxr-xr-xdotfiles/hyprland/.local/bin/layout-navigate11
1 files changed, 11 insertions, 0 deletions
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