diff options
| author | Donald Williams <129223418+dwilliam62@users.noreply.github.com> | 2025-11-05 03:07:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-05 03:07:48 -0500 |
| commit | 83c8c37abeacb32ce609c2d37c8656c1274ac6e0 (patch) | |
| tree | d0e07343825aa39f4b43bc987bfa50012b3f4c9b /config/hypr/scripts/KeybindsLayoutInit.sh | |
| parent | 073fc0fb287777e39e6b9089a5db7a7cf010f24f (diff) | |
| parent | 8361dcc058fb41225630934d37bae65dd9b76e43 (diff) | |
Merge pull request #861 from JaKooLit/ddubs-layout
feat(hypr): layout-aware J/K binds + startup sourcing fixes (v2.3.18)
Diffstat (limited to 'config/hypr/scripts/KeybindsLayoutInit.sh')
| -rwxr-xr-x | config/hypr/scripts/KeybindsLayoutInit.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh new file mode 100755 index 00000000..7e328cde --- /dev/null +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Initialize J/K keybinds to match the current default layout at startup + +# Query current layout (master|dwindle) +LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str') + +case "$LAYOUT" in + master) + # Ensure master layout-style binds + 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 + ;; + dwindle) + # Ensure dwindle layout-style binds + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword unbind SUPER,O + hyprctl keyword bind SUPER,J,cyclenext + hyprctl keyword bind SUPER,K,cyclenext,prev + hyprctl keyword bind SUPER,O,togglesplit + ;; + *) + # Do nothing for unexpected values + : + ;; + esac |
