diff options
Diffstat (limited to 'dotfiles/hyprland/.local/bin/cycle-layout')
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/cycle-layout | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dotfiles/hyprland/.local/bin/cycle-layout b/dotfiles/hyprland/.local/bin/cycle-layout new file mode 100755 index 0000000..ebfd2e0 --- /dev/null +++ b/dotfiles/hyprland/.local/bin/cycle-layout @@ -0,0 +1,29 @@ +#!/bin/sh +# Cycle through Hyprland layouts +# Cycle: master -> hy3 (tab/monocle) -> scrolling -> floating -> master + +LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') +FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false') + +# Check if we're in "all floating" mode by checking layout +case "$LAYOUT" in + master) + hyprctl keyword general:layout hy3 + # Create tab group for monocle behavior + hyprctl dispatch hy3:changegroup tab + ;; + hy3) + hyprctl keyword general:layout scrolling + ;; + scrolling) + # Switch to master but float all windows + hyprctl keyword general:layout master + hyprctl dispatch workspaceopt allfloat + ;; + *) + # Return to master tiled + hyprctl dispatch workspaceopt allfloat + hyprctl keyword general:layout master + hyprctl keyword master:orientation left + ;; +esac |
