aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/KeybindsLayoutInit.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2025-11-14 12:27:19 -0500
committerDon Williams <don.e.williams@gmail.com>2025-11-14 12:27:19 -0500
commit0a9484f35e7726c697e1e64b27355a5f9ebc53b0 (patch)
tree28eeaa4e4967da875dbb30539c00023170360474 /config/hypr/scripts/KeybindsLayoutInit.sh
parentf9e882782d23b2869cd272841af12f7e0ce2ad37 (diff)
Fixed SUPER J/K ping ponging
On branch development Your branch is up to date with 'origin/development'. Changes to be committed: new file: CHANGES-v2.3.18.md modified: config/hypr/scripts/ChangeLayout.sh modified: config/hypr/scripts/KeybindsLayoutInit.sh
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