From f28d694879239d5d9c319185a278236d317a49b6 Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 30 Aug 2025 01:09:18 -0500 Subject: Make sh scrips POSIX compliant Using shellcheck, I went through all of them to make them standards compliant. I also tested as many as I could. --- hypr-layout | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'hypr-layout') diff --git a/hypr-layout b/hypr-layout index 0981c52..c177bb6 100755 --- a/hypr-layout +++ b/hypr-layout @@ -1,9 +1,18 @@ #!/bin/sh -while getopts "dmt" o; do case "${o}" in +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 -- cgit v1.2.3