diff options
| author | Donald Williams <129223418+dwilliam62@users.noreply.github.com> | 2025-12-24 23:30:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-24 23:30:50 -0500 |
| commit | 7fc973e170f2966f752526c59349a93336c3cff5 (patch) | |
| tree | f2f87b58ead90d38296074815c7158d4f4470ccf | |
| parent | 7612539f21326332250c906cdf78fdb97bec9a1c (diff) | |
| parent | f53015625fb88dac6b88cc62fba4f48c7c2d75f6 (diff) | |
Merge pull request #890 from suresh466/fix-cyclenext-cycleprev-window-layout-aware
fix: cycleprev and cyclenext window bindings solution 2
| -rw-r--r-- | config/hypr/configs/Keybinds.conf | 2 | ||||
| -rw-r--r-- | config/hypr/configs/Startup_Apps.conf | 1 | ||||
| -rwxr-xr-x | config/hypr/scripts/ChangeLayout.sh | 31 |
3 files changed, 25 insertions, 9 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 7d0e3fef..ddc516bc 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -97,6 +97,8 @@ bindd = $mainMod, P, toggle pseudo (dwindle), pseudo, # Works on either layout (Master or Dwindle) bindd = $mainMod, M, set split ratio 0.3, exec, hyprctl dispatch splitratio 0.3 +# layout aware keybinds +exec-once = $scriptsDir/ChangeLayout.sh init # Cycle windows; if floating bring to top diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index 0cfb6427..27c8d26a 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -19,7 +19,6 @@ 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 # Drop Down terminal # See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644 diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index e2436b79..221f9637 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -6,19 +6,34 @@ notif="$HOME/.config/swaync/images/ja.png" LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g') +# Reverse layout value to reuse toggle logic. So layouts don't get swapped initially. +if [ "$1" = "init" ]; then + if [ "$LAYOUT" = "master" ]; then + LAYOUT="dwindle" + else + LAYOUT="master" + fi +fi + case $LAYOUT in "master") - hyprctl keyword general:layout dwindle - # SUPER+J/K are global and managed by KeybindsLayoutInit.sh; only manage SUPER+O here - hyprctl keyword bind SUPER,O,togglesplit + hyprctl keyword general:layout dwindle + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword bind SUPER,J,cyclenext + hyprctl keyword bind SUPER,K,cyclenext,prev + hyprctl keyword bind SUPER,O,togglesplit notify-send -e -u low -i "$notif" " Dwindle Layout" - ;; + ;; "dwindle") - hyprctl keyword general:layout master - # Drop togglesplit binding on SUPER+O when switching back to master - hyprctl keyword unbind SUPER,O + hyprctl keyword general:layout master + 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 notify-send -e -u low -i "$notif" " Master Layout" - ;; + ;; *) ;; esac |
