aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2025-11-05 00:50:08 -0500
committerDon Williams <don.e.williams@gmail.com>2025-11-05 00:50:08 -0500
commitebae2be8c6cc37fd6e66baaac18368789ee97851 (patch)
tree3b8691cf633a8d3aa14908563a4856dc1047bd79
parentf992b375bfaf76e82df939ac16502755984db53e (diff)
feat(hypr): align SUPER+J/K binds to current layout on startup\n\n- Add scripts/KeybindsLayoutInit.sh to set J/K (and O for togglesplit) based on general:layout\n- Wire via Startup_Apps.conf (exec-once) so default dwindle or master both get correct binds\n- Complements scripts/ChangeLayout.sh dynamic rebinds
-rw-r--r--config/hypr/configs/Startup_Apps.conf1
-rwxr-xr-xconfig/hypr/scripts/KeybindsLayoutInit.sh30
2 files changed, 31 insertions, 0 deletions
diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf
index d952e65b..07a92a3f 100644
--- a/config/hypr/configs/Startup_Apps.conf
+++ b/config/hypr/configs/Startup_Apps.conf
@@ -19,6 +19,7 @@ exec-once = swww-daemon --format xrgb
# Startup
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
+exec-once = $scriptsDir/KeybindsLayoutInit.sh
# Initialize Drop Down terminal - See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644
exec-once = $HOME/.config/hypr/scripts/Dropterminal.sh kitty &
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage