From d4cdc789378ad620ab47711c5950f7566168fb0b Mon Sep 17 00:00:00 2001 From: T0MuX Date: Fri, 24 Jan 2025 20:59:24 +0100 Subject: [PATCH] U:prompt.sh dynamic --- bashrc.d/prompt.sh | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/bashrc.d/prompt.sh b/bashrc.d/prompt.sh index fd6f090..0111c9c 100644 --- a/bashrc.d/prompt.sh +++ b/bashrc.d/prompt.sh @@ -1,10 +1,3 @@ -# PROMPT -# FG orange 38;5;208m -# FG noir + BG orange 48;5;208;38;5;16m -# FG noir + BG jaune 48;5;214;38;5;16m -# FG noir + BG bleu 48;5;39;38;5;16m -# FG bleu 38;5;39m - # VARIABLES declare -r fg_orange='\001\e[38;5;208m\002' declare -r fg_bleu='\001\e[38;5;39m\002' @@ -24,7 +17,11 @@ p_user() { } p_path() { - echo -e "${bg_jaune} \uEA83 \w" + case $PWD in + $HOME) echo -e "${bg_jaune} \uE617";; + /) echo -e "${bg_jaune} \uF013";; + *) echo -e "${bg_jaune} \uEA83";; + esac } p_date() { @@ -40,14 +37,4 @@ p_input() { echo -e "${fg_orange}\u25B6${reset}" } -PS1="$(p_start)$(p_user) $(p_path) $(p_date)$(p_end)\n$(p_input) " - -#PS1=$'\n\e[0m\e[38;5;208m\uE0B6\e[48;5;208;38;5;16m\u \ -#\e[48;5;214;38;5;16m \uEA83 \w \ -#\e[48;5;39;38;5;16m $(date +%H:%M:%S) [$?]\e[0m\e[38;5;39m\uE0B4\e[0m\n\ -#\e[38;5;208m\u25B6\e[0m ' - -#PS1="\n${reset}${fg_orange}\uE0B6${bg_orange}${fg_noir}\u \ -#${bg_jaune} \uEA83 \w \ -#${bg_bleu} $(date +%H:%M:%S) [$?]${reset}${fg_bleu}\uE0B4${reset}\n\ -#${fg_orange}\u25B6${reset}" +PS1="$(p_start)$(p_user) \$(p_path) \w $(p_date)$(p_end)\n$(p_input) "