summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhypr-layout22
1 files changed, 22 insertions, 0 deletions
diff --git a/hypr-layout b/hypr-layout
new file mode 100755
index 0000000..0981c52
--- /dev/null
+++ b/hypr-layout
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+while getopts "dmt" o; do case "${o}" in
+ d) DWINDLE="y" && unset MASTER ;;
+ m) MASTER="y" && unset DWINDLE ;;
+ t) TOGGLE="y" ;;
+esac done
+
+if [ -n "$TOGGLE" ]; then
+ #CURRENT="$(hyprctl getoptions general:layout -j | jq -a .str | sed 's/"//g')"
+ #case "$CURRENT" in
+ # dwindle) MASTER="y" ;;
+ # master) DWINDLE="y" ;;
+ #esac
+ sed -i -E 's/(layout = )dwindle$/\1mastert/;s/(layout = )master$/\1dwindlet/;s/dwindlet$/dwindle/;s/mastert$/master/' ~/.config/hypr/hyprland.conf
+fi
+
+if [ -n "$MASTER" ]; then
+ hyprctl keywords general:layout master
+elif [ -n "$DWINDLE" ]; then
+ hyprctl keywords general:layout dwindle
+fi