From c6387e7152f44e8a37ce7d1304893c149b37386c Mon Sep 17 00:00:00 2001 From: zachir Date: Sun, 26 Feb 2023 15:25:54 -0600 Subject: add script to toggle or set hyprland layout --- hypr-layout | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 hypr-layout (limited to 'hypr-layout') 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 -- cgit v1.2.3