Skip to content

Examples

Sloth edited this page Apr 16, 2019 · 5 revisions

Example 1

Example 1

.bash_prompt

color_enable='yes'
color_user='1;33'
color_root='1;31'
color_path='1;31'
color_char='1;31'

string_user='\u@\H'
string_path='\W'
string_char='\$'

time_enable='yes'
string_time='\t '
color_time='-'

prompt='${string_time}${string_user} ${string_path} ${string_char}'

Example 2

Example 2

.bash_prompt

color_enable='yes'

color_user='1;33'
color_root='1;31'
color_char='6;31'

string_user='\u'
string_path='\w'
string_char='\$'
export PROMPT_DIRTRIM=2

git_enable='yes'
string_git=' (%s)'
color_git='1;34'

if [[ ${last_cmd_exit} -gt 0 ]];then
    string_cmd='\342\234\227'
    color_cmd='1;31'
else
    string_cmd='\342\234\223'
    color_cmd='1;32'
fi

[[ -w ${PWD} ]] && color_path='3;32' || color_path='3;31'

string_shell="($(awk 'BEGIN{fsh="'${SHELL}'";s=split(fsh,sh,"/");print sh[s]}')/\l)"
color_shell='1;36'

prompt='${string_user}${string_shell}${string_cmd} ${string_path}${string_git} ${string_char}'

Clone this wiki locally