-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_prompt
105 lines (94 loc) · 3.43 KB
/
.bash_prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
if [ -f /etc/bash_completion.d/git-prompt ]; then
source /etc/bash_completion.d/git-prompt
elif [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then
source /usr/share/git-core/contrib/completion/git-prompt.sh
else
function __git_ps1
{
:
}
fi
export VIRTUAL_ENV_DISABLE_PROMPT=1
function __virtualenv_info()
{
if [[ -n "$VIRTUAL_ENV" ]]; then
venv="${VIRTUAL_ENV##*/}"
else
venv=''
fi
[[ -n "$venv" ]] && echo " (venv:$venv)"
}
function __pretty_prompt
{
# Reset
local Color_Off="\[\e[0m\]" #Text Reset
# Regular Colors
local Black="\[\e[0;30m\]" # Black
local Red="\[\e[0;31m\]" # Red
local Green="\[\e[0;32m\]" # Green
local Yellow="\[\e[0;33m\]" # Yellow
local Blue="\[\e[0;34m\]" # Blue
local Purple="\[\e[0;35m\]" # Purple
local Cyan="\[\e[0;36m\]" # Cyan
local White="\[\e[0;37m\]" # White
# Bold
local BBlack="\[\e[1;30m\]" # Black
local BRed="\[\e[1;31m\]" # Red
local BGreen="\[\e[1;32m\]" # Green
local BYellow="\[\e[1;33m\]" # Yellow
local BBlue="\[\e[1;34m\]" # Blue
local BPurple="\[\e[1;35m\]" # Purple
local BCyan="\[\e[1;36m\]" # Cyan
local BWhite="\[\e[1;37m\]" # White
# Underline
local UBlack="\[\e[4;30m\]" # Black
local URed="\[\e[4;31m\]" # Red
local UGreen="\[\e[4;32m\]" # Green
local UYellow="\[\e[4;33m\]" # Yellow
local UBlue="\[\e[4;34m\]" # Blue
local UPurple="\[\e[4;35m\]" # Purple
local UCyan="\[\e[4;36m\]" # Cyan
local UWhite="\[\e[4;37m\]" # White
# Background
local On_Black="\[\e[40m\]" # Black
local On_Red="\[\e[41m\]" # Red
local On_Green="\[\e[42m\]" # Green
local On_Yellow="\[\e[43m\]" # Yellow
local On_Blue="\[\e[44m\]" # Blue
local On_Purple="\[\e[45m\]" # Purple
local On_Cyan="\[\e[46m\]" # Cyan
local On_White="\[\e[47m\]" # White
# High Intensity
local IBlack="\[\e[0;90m\]" # Black
local IRed="\[\e[0;91m\]" # Red
local IGreen="\[\e[0;92m\]" # Green
local IYellow="\[\e[0;93m\]" # Yellow
local IBlue="\[\e[0;94m\]" # Blue
local IPurple="\[\e[0;95m\]" # Purple
local ICyan="\[\e[0;96m\]" # Cyan
local IWhite="\[\e[0;97m\]" # White
# Bold High Intensity
local BIBlack="\[\e[1;90m\]" # Black
local BIRed="\[\e[1;91m\]" # Red
local BIGreen="\[\e[1;92m\]" # Green
local BIYellow="\[\e[1;93m\]" # Yellow
local BIBlue="\[\e[1;94m\]" # Blue
local BIPurple="\[\e[1;95m\]" # Purple
local BICyan="\[\e[1;96m\]" # Cyan
local BIWhite="\[\e[1;97m\]" # White
# High Intensity backgrounds
local On_IBlack="\[\e[0;100m\]" # Black
local On_IRed="\[\e[0;101m\]" # Red
local On_IGreen="\[\e[0;102m\]" # Green
local On_IYellow="\[\e[0;103m\]" # Yellow
local On_IBlue="\[\e[0;104m\]" # Blue
local On_IPurple="\[\e[0;105m\]" # Purple
local On_ICyan="\[\e[0;106m\]" # Cyan
local On_IWhite="\[\e[0;107m\]" # White
# Final build and set
local LineOne="${BYellow}\u${BCyan}@${BGreen}\h${Color_Off} ${BBlack}[${Logo}${BBlack}\t ${UBlack}\#${Color_Off}${BBlack}\$(__git_ps1 \" (git:%s)\")\$(__virtualenv_info)]${Color_Off}"
local LineTwo="${BBlue}\w${Color_Off}"
local LineThree="${White}\$${Color_Off}"
export PS1="\n${LineOne}\n${LineTwo}\n${LineThree} "
}
__pretty_prompt