diff options
Diffstat (limited to 'src/runscreen.sh')
| -rwxr-xr-x | src/runscreen.sh | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ | |||
| 3 | # This file exists because I've gotten to the point where I need to open the terminal in specific dimensions | 3 | # This file exists because I've gotten to the point where I need to open the terminal in specific dimensions |
| 4 | # or the thing looks bad | 4 | # or the thing looks bad |
| 5 | 5 | ||
| 6 | BINNAME="main" | ||
| 7 | SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")" | ||
| 8 | |||
| 6 | main() { | 9 | main() { |
| 7 | # Stop interrupts | 10 | # Stop interrupts |
| 8 | trap '' INT | 11 | trap '' INT |
| 9 | 12 | ||
| 10 | # Get location of script | 13 | # Make sure script location is there |
| 11 | SCRIPT_DIR="$(cd "$(dirname "$0")" && echo "$PWD")" | ||
| 12 | if [ -z "$SCRIPT_DIR" ]; then | 14 | 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 | 15 | 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 | 16 | return 1 |
| 15 | fi | 17 | fi |
| 16 | 18 | ||
| 17 | # Check to make sure the screen binary exists | 19 | # Check to make sure the screen binary exists |
| 18 | if [ ! -x "$SCRIPT_DIR/screen" ]; then | 20 | if [ ! -x "$SCRIPT_DIR/$BINNAME" ]; then |
| 19 | printf "\033[38;2;255;0;0m\033[1m[runscreen.sh] Screen binary doesn't exist. Exiting...\n\033[m" 1>&2 | 21 | 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 | 22 | return 1 |
| 21 | fi | 23 | fi |
| 22 | 24 | ||
| 23 | # Run the thing in gnome terminal | 25 | # Run the thing in gnome terminal |
| 24 | gnome-terminal --hide-menubar --geometry=156x27 --wait -- "$SCRIPT_DIR/screen" \ | 26 | gnome-terminal --hide-menubar --geometry=156x27 --wait -- "$SCRIPT_DIR/$BINNAME" \ |
| 25 | && return $? | 27 | && return $? |
| 26 | 28 | ||
| 27 | } | 29 | } |
| 28 | 30 | ||
| 29 | main && exit $? \ No newline at end of file | 31 | main && exit $? |
