#!/usr/bin/env bash # --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. --- # layout-selector.sh # Select a workspace layout using Wofi, shows description, applies with layoutmsg # Define layouts and descriptions declare -A LAYOUTS=( [dwindle]="舘 Dwindle: Auto-tiling, windows shrink progressively" [master]=" Master: One main window, others stacked" [scrolling]=" Scrolling: Vertical list, scroll through windows" [monocle]=" Monocle: One window fills the screen" [floating]=" Floating: Free move & resize" ) ORDER=(dwindle master scrolling monocle floating) # Prepare Wofi menu: show "layoutname: description" MENU_ITEMS=() for key in "${ORDER[@]}"; do MENU_ITEMS+=("$key: ${LAYOUTS[$key]}") done # Show selection menu via Wofi CHOICE=$(printf '%s\n' "${MENU_ITEMS[@]}" | wofi --dmenu --prompt "Select Layout") # Exit if cancelled [ -z "$CHOICE" ] && exit 0 # Extract layout name from selection (before colon) LAYOUT_NAME="${CHOICE%%:*}" # Apply layout via layoutmsg hyprctl dispatch layoutmsg setlayout "$LAYOUT_NAME" # Show OSD feedback hyprctl dispatch oSD "Layout: $LAYOUT_NAME" 2000