summaryrefslogtreecommitdiff
path: root/src/runscreen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/runscreen.sh')
-rwxr-xr-xsrc/runscreen.sh37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/runscreen.sh b/src/runscreen.sh
index 1bbdc78..14dabe5 100755
--- a/src/runscreen.sh
+++ b/src/runscreen.sh
@@ -1,18 +1,29 @@
1#!/usr/bin/env -S sh 1#!/usr/bin/env -S sh
2 2
3# Stop interrupts 3# This file exists because I've gotten to the point where I need to open the terminal in specific dimensions
4trap '' INT 4# or the thing looks bad
5 5
6# Get location of script 6main() {
7SCRIPT_DIR="$(cd $(dirname "$0") && echo "$PWD")" 7 # Stop interrupts
8if [ -z "$SCRIPT_DIR" ]; then 8 trap '' INT
9 printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Couldn't get location of script. Exiting...\n\033[m" 1>&2
10 exit 1
11fi
12 9
13# Run the thing in gnome terminal 10 # Get location of script
14gnome-terminal --hide-menubar --geometry=132x24 --wait -- "$SCRIPT_DIR/screen" \ 11 SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")"
15 && exit $? 12 if [ -z "$SCRIPT_DIR" ]; then
13 printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Couldn't get location of script. Exiting...\n\033[m" 1>&2
14 return 1
15 fi
16 16
17# This file exists because I've gotten to the point where I need to open the terminal in specific dimensions 17 # Check to make sure the screen binary exists
18# or the thing looks bad \ No newline at end of file 18 if [ ! -x "$SCRIPT_DIR/screen" ]; then
19 printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Screen binary doesn't exist. Exiting...\n\033[m" 1>&2
20 return 1
21 fi
22
23 # Run the thing in gnome terminal
24 gnome-terminal --hide-menubar --geometry=132x24 --wait -- "$SCRIPT_DIR/screen" \
25 && return $?
26
27}
28
29main && exit $? \ No newline at end of file