Files
hyprland-dotfiles/scripts/select-layout
T
2026-08-12 22:58:34 -07:00

29 lines
712 B
Bash
Executable File

#!/bin/sh
set -eu
selection="$({
printf '1\tDwindle — binary split\n'
printf '2\tMaster — main window plus stack\n'
printf '3\tScrolling — columns\n'
printf '4\tMonocle — one window at a time\n'
} | noctalia dmenu -p 'Layout for current workspace (1-4)')" || exit 0
case "$selection" in
1*) layout=dwindle ;;
2*) layout=master ;;
3*) layout=scrolling ;;
4*) layout=monocle ;;
*) exit 0 ;;
esac
workspace="$(hyprctl activeworkspace -j | jq -r '.id')"
case "$workspace" in
''|*[!0-9]*) exit 1 ;;
esac
# Workspace rules are scoped to this workspace; changing general:layout would
# affect every workspace.
hyprctl keyword workspace "$workspace, layout:$layout"