summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/layout-resize
blob: c7e01511abdc941038cfe2c97cd875423c95ef1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# Layout-aware resize for Hyprland
# Usage: layout-resize <grow|shrink>

DIR="$1"
LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str')

case "$LAYOUT" in
    scrolling)
        if [ "$DIR" = "grow" ]; then
            hyprctl dispatch resizeactive 50 0
        else
            hyprctl dispatch resizeactive -50 0
        fi
        ;;
    *)
        # master, dwindle, etc.
        if [ "$DIR" = "grow" ]; then
            hyprctl dispatch splitratio 0.05
        else
            hyprctl dispatch splitratio -0.05
        fi
        ;;
esac