From 32c0b021c53ac079935551d6a647813982e5779c Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Thu, 16 Jul 2026 18:59:48 +0200 Subject: [PATCH] feat(rc): Add preference for starship prompt over powerline-go --- rc.d/prompt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rc.d/prompt b/rc.d/prompt index 7873296..fc28674 100644 --- a/rc.d/prompt +++ b/rc.d/prompt @@ -2,7 +2,9 @@ # Customize the prompt -MY_PROMPTS="powerline-go starship" +# Indicate your preference order for prompt tools +# The first one found available will be used +MY_PROMPTS="starship powerline-go" for prompt in $MY_PROMPTS; do if (command -v "$prompt" &>/dev/null); then @@ -11,26 +13,26 @@ for prompt in $MY_PROMPTS; do fi done -case "$USE_PROMPT" in +case "${USE_PROMPT}" in +# https://starship.rs/ "starship") if (command -v starship &>/dev/null); then - # echo "Using $USE_PROMPT prompt" eval "$(starship init bash)" else - echo "$USE_PROMPT command not found" + echo "${USE_PROMPT} command not found" fi ;; +# https://github.com/justjanne/powerline-go "powerline-go") if (command -v powerline-go &>/dev/null); then - # echo "Using $USE_PROMPT prompt" function _update_ps1() { PS1=$(powerline-go -jobs "$(jobs -p | wc -l)" -error $? -modules "ssh,host,wsl,user,cwd,direnv,venv,perms,git,jobs,exit,root" -modules-right "docker,docker-context,kube,terraform-workspace,termtitle" -newline) } if [ "$TERM" != "linux" ]; then _prompt_command_add "_update_ps1"; fi else - echo "$USE_PROMPT command not found" + echo "${USE_PROMPT} command not found" fi ;;