From 567d14881df3e405bd9f955c18978cf14ee4c12b Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Fri, 30 Aug 2024 18:11:32 -0500 Subject: lol, lmao --- src/runscreen.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/runscreen.sh') diff --git a/src/runscreen.sh b/src/runscreen.sh index f0dac47..7873451 100755 --- a/src/runscreen.sh +++ b/src/runscreen.sh @@ -3,27 +3,29 @@ # This file exists because I've gotten to the point where I need to open the terminal in specific dimensions # or the thing looks bad +BINNAME="main" +SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")" + main() { # Stop interrupts trap '' INT - # Get location of script - SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")" + # Make sure script location is there if [ -z "$SCRIPT_DIR" ]; then printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Couldn't get location of script. Exiting...\n\033[m" 1>&2 return 1 fi # Check to make sure the screen binary exists - if [ ! -x "$SCRIPT_DIR/screen" ]; then + if [ ! -x "$SCRIPT_DIR/$BINNAME" ]; then printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Screen binary doesn't exist. Exiting...\n\033[m" 1>&2 return 1 fi # Run the thing in gnome terminal - gnome-terminal --hide-menubar --geometry=156x27 --wait -- "$SCRIPT_DIR/screen" \ + gnome-terminal --hide-menubar --geometry=156x27 --wait -- "$SCRIPT_DIR/$BINNAME" \ && return $? } -main && exit $? \ No newline at end of file +main && exit $? -- cgit v1.2.3