aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/KeybindsLayoutInit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/scripts/KeybindsLayoutInit.sh')
-rwxr-xr-xconfig/hypr/scripts/KeybindsLayoutInit.sh40
1 files changed, 8 insertions, 32 deletions
diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh
index fd34f90e..0a53eaaf 100755
--- a/config/hypr/scripts/KeybindsLayoutInit.sh
+++ b/config/hypr/scripts/KeybindsLayoutInit.sh
@@ -1,38 +1,14 @@
#!/usr/bin/env bash
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
-# Initialize J/K keybinds to match the current default layout at startup
+# Initialize J/K keybinds so they always cycle windows globally (no layout-specific behavior)
+# This avoids double-actions when layouts change.
set -euo pipefail
-# Determine current layout (master|dwindle); be robust to null at startup
-LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str // empty' 2>/dev/null || true)
-if [ -z "${LAYOUT:-}" ]; then
- # Fallback: parse non-JSON output (e.g., "str: dwindle")
- LAYOUT=$(hyprctl getoption general:layout 2>/dev/null | awk -F'str:' 'NF>1 {gsub(/^ +| +$/,"",$2); print $2}')
-fi
-[ -z "${LAYOUT:-}" ] && exit 0
+# Always reset and bind SUPER+J/K the same way on startup
+hyprctl keyword unbind SUPER,J || true
+hyprctl keyword unbind SUPER,K || true
-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
- # ensure SUPER+O togglesplit is available on dwindle
- hyprctl keyword bind SUPER,O,togglesplit
- ;;
- *)
- # Do nothing for unexpected values
- :
- ;;
- esac
+# Cycle windows globally: J = next, K = previous
+hyprctl keyword bind SUPER,J,cyclenext
+hyprctl keyword bind SUPER,K,cyclenext,prev
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage