From da43e7533d1dd6e2cf652570d3c2c4ef8d6c923c Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 9 Jun 2022 20:14:51 +0000 Subject: [PATCH] Allow defaulting to starship --- dotfiles/zshrc.d/functions.zsh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dotfiles/zshrc.d/functions.zsh b/dotfiles/zshrc.d/functions.zsh index 52d33b6..0fe20b7 100644 --- a/dotfiles/zshrc.d/functions.zsh +++ b/dotfiles/zshrc.d/functions.zsh @@ -3,11 +3,21 @@ function dumpenv { } if test -x "/sbin/starship" ; then + _STARSHIP_PATH="/sbin/starship" function starship_prompt { eval $(/sbin/starship init zsh) } elif test -x "${HOME}/tools/starship/starship" ; then + _STARSHIP_PATH="${HOME}/tools/starship/starship" function starship_prompt { eval $($HOME/tools/starship/starship init zsh) } fi +if test -f ${HOME}/.zprompt ; then + if test "$(cat ${HOME}/.zprompt)" = "starship" ; then + if test -n "${_STARSHIP_PATH:-}" ; then + eval $(${_STARSHIP_PATH} init zsh) + fi + fi +fi +unset _STARSHIP_PATH