Incomplete but basic bash prompt theming
This commit is contained in:
parent
62900e7957
commit
c7af516ea8
31
bash/bash_prompt.sh
Normal file
31
bash/bash_prompt.sh
Normal file
@ -0,0 +1,31 @@
|
||||
angle="❯"
|
||||
|
||||
NO_FORMAT="\033[0m"
|
||||
|
||||
C_SEAGREEN2="\033[38;5;83m"
|
||||
C_INDIANRED1="\033[38;5;203m"
|
||||
C_GREY89="\033[38;5;254m"
|
||||
|
||||
#If user is root
|
||||
if [[ "$USER" == "root" ]]; then
|
||||
char1_col="$C_SEAGREEN2";
|
||||
home_col="$C_INDIANRED1";
|
||||
else
|
||||
char1_col="$C_GREY89";
|
||||
home_col="$C_SEAGREEN2";
|
||||
fi
|
||||
|
||||
#If previous commant was successful
|
||||
if [[ "$?" -eq "0" ]]; then
|
||||
char4_col="$C_SEAGREEN2";
|
||||
else
|
||||
char4_col="$C_INDIANRED1";
|
||||
fi
|
||||
|
||||
char3_col="$C_SEAGREEN2";
|
||||
|
||||
dir=$(pwd | sd "$HOME" "$home_col~$NO_FORMAT")
|
||||
|
||||
prompt="$dir"
|
||||
|
||||
echo -e "$dir$char1_col$angle$NO_FORMAT$angle$char3_col$angle$char4_col$angle$NO_FORMAT"
|
Loading…
Reference in New Issue
Block a user