#!/bin/sh # Hyprland layout indicator for waybar # Shows current layout with nerd font icons # Layouts: master -> tab group (monocle) -> scrolling -> floating # Get current layout LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str') # Check if workspace has allfloat enabled ALLFLOAT=$(hyprctl activeworkspace -j | jq -r '.hasfullscreenwindow') # Check if active window is floating FLOATING=$(hyprctl activewindow -j 2>/dev/null | jq -r '.floating // false') # Check workspace rules for allfloat WSRULES=$(hyprctl activeworkspace -j | jq -r '.rules // []') # Determine icon and tooltip if [ "$LAYOUT" = "master" ] && echo "$WSRULES" | grep -q "allfloat"; then ICON="󰖲" TOOLTIP="Floating" elif [ "$LAYOUT" = "scrolling" ]; then ICON="󰯍" TOOLTIP="Scrolling" elif [ "$LAYOUT" = "hy3" ]; then ICON="󰖯" TOOLTIP="Tab Group (Monocle)" elif [ "$LAYOUT" = "master" ]; then ICON="󰕰" TOOLTIP="Master" else ICON="󰕰" TOOLTIP="$LAYOUT" fi echo "{\"text\": \"$ICON\", \"tooltip\": \"$TOOLTIP\"}"