aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/ChangeLayout.sh
diff options
context:
space:
mode:
authorSuresh Thagunna <suresh.thagunna77@gmail.com>2025-12-22 18:05:07 -0500
committerSuresh Thagunna <suresh.thagunna77@gmail.com>2025-12-23 09:48:04 -0500
commit862e49f7a3013b8c948d0036002cd07527b474cd (patch)
tree23c68b1c37363c781f85f365eca1d48494ce174f /config/hypr/scripts/ChangeLayout.sh
parent4da114f5e42f5b3c95109c9737ece7fcfbd2bd39 (diff)
fix: layout aware cycleprev and cyclenext window bindings
Diffstat (limited to 'config/hypr/scripts/ChangeLayout.sh')
-rwxr-xr-xconfig/hypr/scripts/ChangeLayout.sh31
1 files changed, 23 insertions, 8 deletions
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage