aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.local/bin/layout-resize
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-03-07 11:18:18 -0600
committerCraig Jennings <c@cjennings.net>2026-03-07 11:18:18 -0600
commit324377297f06e610993a687c2c03740efd8b221e (patch)
treedee923aa574a8711a67a765a702d64e1067bf282 /dotfiles/hyprland/.local/bin/layout-resize
parent23c98b106d3521485276b3811938ceaeec5811ce (diff)
downloadarchsetup-324377297f06e610993a687c2c03740efd8b221e.tar.gz
archsetup-324377297f06e610993a687c2c03740efd8b221e.zip
feat(hyprland): add monocle layout support, fix scrolling keybindings
Add monocle to layout cycle and waybar indicator. Fix scrolling layout move (swapwindow) and resize (resizeactive). Add layout-resize script.
Diffstat (limited to 'dotfiles/hyprland/.local/bin/layout-resize')
-rwxr-xr-xdotfiles/hyprland/.local/bin/layout-resize24
1 files changed, 24 insertions, 0 deletions
diff --git a/dotfiles/hyprland/.local/bin/layout-resize b/dotfiles/hyprland/.local/bin/layout-resize
new file mode 100755
index 0000000..c7e0151
--- /dev/null
+++ b/dotfiles/hyprland/.local/bin/layout-resize
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Layout-aware resize for Hyprland
+# Usage: layout-resize <grow|shrink>
+
+DIR="$1"
+LAYOUT=$(hyprctl getoption general:layout -j | jq -r '.str')
+
+case "$LAYOUT" in
+ scrolling)
+ if [ "$DIR" = "grow" ]; then
+ hyprctl dispatch resizeactive 50 0
+ else
+ hyprctl dispatch resizeactive -50 0
+ fi
+ ;;
+ *)
+ # master, dwindle, etc.
+ if [ "$DIR" = "grow" ]; then
+ hyprctl dispatch splitratio 0.05
+ else
+ hyprctl dispatch splitratio -0.05
+ fi
+ ;;
+esac