scripts/bashrc.d/prompt.sh

41 lines
805 B
Bash
Raw Normal View History

2025-01-24 17:54:10 +00:00
# VARIABLES
declare -r fg_orange='\001\e[38;5;208m\002'
declare -r fg_bleu='\001\e[38;5;39m\002'
declare -r fg_noir='\001\e[38;5;16m\002'
declare -r bg_orange='\001\e[48;5;208m\002'
declare -r bg_jaune='\001\e[48;5;214m\002'
declare -r bg_bleu='\001\e[48;5;39m\002'
declare -r reset='\001\e[0m\002'
# FONCTIONS
p_start() {
echo -e "\n${reset}${fg_orange}\uE0B6"
}
p_user() {
echo -e "${bg_orange}${fg_noir}\u"
}
p_path() {
2025-01-24 19:59:24 +00:00
case $PWD in
$HOME) echo -e "${bg_jaune} \uE617";;
/) echo -e "${bg_jaune} \uF013";;
*) echo -e "${bg_jaune} \uEA83";;
esac
2025-01-24 17:54:10 +00:00
}
p_date() {
echo -e "${bg_bleu} $(date +%H:%M:%S) [$?]${reset}"
}
p_end() {
echo -e "${fg_bleu}\uE0B4${reset}"
}
p_input() {
echo -e "${fg_orange}\u25B6${reset}"
}
2025-01-24 19:59:24 +00:00
PS1="$(p_start)$(p_user) \$(p_path) \w $(p_date)$(p_end)\n$(p_input) "