Use color declared in disp.sh
This commit is contained in:
@@ -92,37 +92,27 @@ function timer_stop
|
||||
set_prompt()
|
||||
{
|
||||
local Last_Command=$? # Must come first!
|
||||
local Blue='\[\e[0;34m\]'
|
||||
local White='\[\e[01;37m\]'
|
||||
local Yellow='\[\e[01;93m\]'
|
||||
local Red='\[\e[01;31m\]'
|
||||
local Green='\[\e[01;32m\]'
|
||||
local OnGrey='\[\e[47m\]'
|
||||
local OnRed='\[\e[41m\]'
|
||||
local OnBlue='\[\e[44m\]'
|
||||
local ICyan='\[\e[0;96m\]'
|
||||
local Default='\[\e[00m\]'
|
||||
local FancyX='\342\234\227'
|
||||
local Checkmark='\342\234\223'
|
||||
|
||||
# Begin with time
|
||||
PS1="\[\e[s$Blue$OnGrey [ \t ] $OnBlue"
|
||||
PS1="\[\e[s$Blue$OnGrey [ \t ] $On_Blue"
|
||||
|
||||
# Add a bright white exit status for the last command
|
||||
|
||||
# If it was successful, print a green check mark. Otherwise, print
|
||||
# a red X.
|
||||
if [[ $Last_Command == 0 ]]; then
|
||||
PS1+="$White$OnBlue [ \$Last_Command "
|
||||
PS1+="$White$On_Blue [ \$Last_Command "
|
||||
PS1+="$Green$Checkmark "
|
||||
else
|
||||
PS1+="$White$OnRed [ \$Last_Command "
|
||||
PS1+="$Yellow$FancyX "
|
||||
PS1+="$White$On_Red [ \$Last_Command "
|
||||
PS1+="$BYellow$FancyX "
|
||||
fi
|
||||
|
||||
# Add the ellapsed time and current date
|
||||
timer_stop
|
||||
PS1+="($timer_show)$White ] $OnBlue "
|
||||
PS1+="($timer_show)$White ] $On_Blue "
|
||||
|
||||
# If root, just print the host in red. Otherwise, print the current user
|
||||
# and host in green.
|
||||
@@ -131,10 +121,10 @@ set_prompt()
|
||||
else
|
||||
PS1+="$Green\\u@\\h"
|
||||
fi
|
||||
PS1+="\e[K\e[u$Default\n"
|
||||
PS1+="\e[K\e[u$DEFAULTCOL\n"
|
||||
# Print the working directory and prompt marker in blue, and reset
|
||||
# the text color to the default.
|
||||
PS1+="$ICyan\\w \\\$$Default "
|
||||
PS1+="$ICyan\\w \\\$$DEFAULTCOL "
|
||||
}
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user