From 3f7ea82def91c571144114f9ad57186ce2aad037 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 18 May 2022 00:21:46 -0500 Subject: [PATCH] check for tty --- bin/is-executable | 2 +- bin/is-tty | 8 ++++++++ home/dot_zshrc | 2 +- system/env.sh | 6 +++++- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 bin/is-tty diff --git a/bin/is-executable b/bin/is-executable index 1943a11..31e2fa1 100755 --- a/bin/is-executable +++ b/bin/is-executable @@ -4,4 +4,4 @@ if [ -x "$(command -v $1)" ]; then exit 0 else exit 1 -fi \ No newline at end of file +fi diff --git a/bin/is-tty b/bin/is-tty new file mode 100755 index 0000000..6c1d2ba --- /dev/null +++ b/bin/is-tty @@ -0,0 +1,8 @@ +#!/bin/sh + +case $(tty) in /dev/tty[0-9]*) + exit 0;; + *) + exit 1;; +esac + diff --git a/home/dot_zshrc b/home/dot_zshrc index d2bedd6..d03527e 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -35,4 +35,4 @@ unset EXTRAFILE export DOTFILES_DIR DOTFILES_EXTRA_DIR -[ -f ~/.welcome ] && clear && cat ~/.welcome +[ -f ~/.welcome ] && [ ! is-tty ] && clear && cat ~/.welcome diff --git a/system/env.sh b/system/env.sh index 9ed2616..4761b11 100644 --- a/system/env.sh +++ b/system/env.sh @@ -67,7 +67,11 @@ fi export ENHANCD_DOT_ARG="up" -export STARSHIP_CONFIG=~/.config/starship/config.toml +if is-tty; then + export STARSHIP_CONFIG=~/.config/starship/plain.toml +else + export STARSHIP_CONFIG=~/.config/starship/config.toml +fi export EGET_BIN=$HOME/bin