#!/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