-
Notifications
You must be signed in to change notification settings - Fork 0
/
ps1.sh
56 lines (48 loc) · 1.73 KB
/
ps1.sh
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
#################################
# Github Branch
#################################
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
#################################
# Color for git branch by-state
#################################
acolor() {
[[ -n $(git status --porcelain=v2 2>/dev/null) ]] && echo 31 || echo 33
}
#################################
# Custom PS1
#################################
PS1="\[\033[33m\]" # Change color to pink
PS1="$PS1""➜ " # Cool little arrow
PS1="$PS1""\[\033[32m\]" # Change color to green
PS1="$PS1""\W" # Show current directory
PS1="$PS1""\[\033[\$(acolor)m\]" # Fancy git magic
PS1="$PS1""\$(git_branch)" # Display git info if applicable
#################################
# Python Virtual Environment PS1
#################################
# disable the default virtualenv prompt change
# if [[ -n "$VIRTUAL_ENV" ]]; then
# export VIRTUAL_ENV_DISABLE_PROMPT=1
# function __virtualenv_ps1 {
# echo "${VIRTUAL_ENV:+venv:${VIRTUAL_ENV##*/}}"
# }
# export VIRTUAL_ENV_DISABLE_PROMPT=1
# PS1="$PS1""\[\033[94m\]"
# PS1="$PS1""-(\$(__virtualenv_ps1))" # Show current directory
# fi
PS1="$PS1""\[\033[00m\] " # Change color to white
export PS1;
################
# Test Tier PS1
################
# Set PS1
# PS1="\[\033[32m\]" # Set color to green
# PS1="$PS1""\h" # Display tier name
# PS1="$PS1""\[\033[0;31m\]" # Set color to red
# PS1="$PS1"" ➜ " # Display arrow
# PS1="$PS1""\[\033[33;1m\]" # Set color to yellow
# PS1="$PS1""\w" # Display current directory
# PS1="$PS1""\[\033[m\] " # Change color to default
# export PS1