diff options
| author | Donald Williams <129223418+dwilliam62@users.noreply.github.com> | 2025-12-29 09:41:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-29 09:41:55 -0500 |
| commit | 4e8cb959c0fbf0109dbb3d4342d8aaa2e4c1d470 (patch) | |
| tree | 944daf4ad373740460ca66a76e58bae839f54905 /config/hypr/scripts/ChangeLayout.sh | |
| parent | 59713a66e3dce8b2c006dc1ce7847b761d759147 (diff) | |
| parent | cafaa576cbe7018f4c3ef3301fde16b807e74190 (diff) | |
Merge branch 'development' into patch-3
Diffstat (limited to 'config/hypr/scripts/ChangeLayout.sh')
| -rwxr-xr-x | config/hypr/scripts/ChangeLayout.sh | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index e2436b79..221f9637 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -6,19 +6,34 @@ notif="$HOME/.config/swaync/images/ja.png" LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g') +# Reverse layout value to reuse toggle logic. So layouts don't get swapped initially. +if [ "$1" = "init" ]; then + if [ "$LAYOUT" = "master" ]; then + LAYOUT="dwindle" + else + LAYOUT="master" + fi +fi + case $LAYOUT in "master") - hyprctl keyword general:layout dwindle - # SUPER+J/K are global and managed by KeybindsLayoutInit.sh; only manage SUPER+O here - hyprctl keyword bind SUPER,O,togglesplit + hyprctl keyword general:layout dwindle + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword bind SUPER,J,cyclenext + hyprctl keyword bind SUPER,K,cyclenext,prev + hyprctl keyword bind SUPER,O,togglesplit notify-send -e -u low -i "$notif" " Dwindle Layout" - ;; + ;; "dwindle") - hyprctl keyword general:layout master - # Drop togglesplit binding on SUPER+O when switching back to master - hyprctl keyword unbind SUPER,O + hyprctl keyword general:layout master + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword unbind SUPER,O + hyprctl keyword bind SUPER,J,layoutmsg,cyclenext + hyprctl keyword bind SUPER,K,layoutmsg,cycleprev notify-send -e -u low -i "$notif" " Master Layout" - ;; + ;; *) ;; esac |
