#!/bin/sh printhelp () { printf "hypr-layout: sets the hyprland layout.\n" printf "\t-d) dwindle layout\n" printf "\t-m) master layout\n" printf "\t-t) toggle between master and dwindle\n" exit 1 } while getopts "dmst" o; do case "${o}" in d) DWINDLE="y" && unset MASTER ;; m) MASTER="y" && unset DWINDLE ;; t) TOGGLE="y" ;; *) printhelp ;; 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