From 0a9484f35e7726c697e1e64b27355a5f9ebc53b0 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 14 Nov 2025 12:27:19 -0500 Subject: 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 --- config/hypr/scripts/KeybindsLayoutInit.sh | 40 +++++++------------------------ 1 file changed, 8 insertions(+), 32 deletions(-) (limited to 'config/hypr/scripts/KeybindsLayoutInit.sh') 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 -- cgit v1.2.3