summaryrefslogtreecommitdiff
path: root/hypr-layout
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-26 15:25:54 -0600
committerzachir <zachir@librem.one>2023-02-26 15:25:54 -0600
commitc6387e7152f44e8a37ce7d1304893c149b37386c (patch)
treee68f39aaa8833cf103df7074051e6d9ce7464edf /hypr-layout
parent73120ad4a268fa17539df66970faea89e2fa05b6 (diff)
add script to toggle or set hyprland layout
Diffstat (limited to 'hypr-layout')
-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