From b6ca38a4b519377fc052574ee33f81f25948bd99 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 16 Sep 2024 11:50:19 -0700 Subject: [PATCH] shell: launch zsh if we can --- .config/shell/env | 3 +++ .config/shell/plugins | 8 ++++++++ .zshrc | 2 ++ 3 files changed, 13 insertions(+) diff --git a/.config/shell/env b/.config/shell/env index 0441a02..4d831fe 100644 --- a/.config/shell/env +++ b/.config/shell/env @@ -75,6 +75,9 @@ if test -n "${ZSH_VERSION:-}"; then export NIX_BUILD_SHELL=zsh fi +# Launch zsh if we haven't yet +LAUNCH_ZSH="${LAUNCH_ZSH:-true}" + # Basic default LS colors export LSCOLORS="Gxfxcxdxbxegedabagacad" diff --git a/.config/shell/plugins b/.config/shell/plugins index da0fd55..ee9d0df 100644 --- a/.config/shell/plugins +++ b/.config/shell/plugins @@ -13,3 +13,11 @@ if command -v zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then eval "$(zoxide init posix --hook prompt)" fi fi + +# Switch to zsh if we're told to +if [ "${LAUNCH_ZSH:-false}" = true ] && command -v zsh > /dev/null 2>&1; then + LAUNCH_ZSH=false exec zsh +fi + +# terminal colorscheme +careful_source "$SHELL_CONFIG_DIR/colors.sh" diff --git a/.zshrc b/.zshrc index 1ecff9f..21561c6 100644 --- a/.zshrc +++ b/.zshrc @@ -265,6 +265,8 @@ load_working_dir && cd - > /dev/null || true # <<< # <<< +export BASH_LAUNCH_ZSH=false + # Optionally source another zshrc ${SKIP_LOCAL_ZSHRC:-false} || careful_source "$SHELL_CONFIG_DIR/local/zshrc"