-
Notifications
You must be signed in to change notification settings - Fork 0
/
.customization
63 lines (58 loc) · 2.23 KB
/
.customization
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
##########################
# Terminal Customization #
##########################
# Check that terminfo exists before changing TERM var to xterm-256color
# Prevents prompt flashing in Mac OS X 10.6 Terminal.app
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM='xterm-256color'
fi
tput sgr 0 0
# Base styles and color palette
# Solarized colors
# https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized
BOLD=$(tput bold)
RESET=$(tput sgr0)
YELLOW=$(tput setaf 136)
ORANGE=$(tput setaf 214)
RED=$(tput setaf 1)
MAGENTA=$(tput setaf 125)
VIOLET=$(tput setaf 63)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 45)
GREEN=$(tput setaf 2)
WHITE=$(tput setaf 231)
GRAY=$(tput setaf 8)
RANDOM=$$$(date +%s) # RANDOM Helper
expressions=("😀" "😐" "😱" "💩" "🍌" "😂" "😇" "🙃" "🌮" "🍻" "🔥 🔥 🔥")
#expressions=("(/゚Д゚)/" "щ(ºДºщ)" "¯\_(ツ)_/¯" "「(°ヘ°)" "(╯°□°)╯︵ ┻━┻" "༼ つ ◕_◕ ༽つ" "(ಠ_ಠ)" "(ノ゚0゚)ノ")
style_user="\[${RESET}${CYAN}\]"
style_host="\[${RESET}${GRAY}\]"
style_path="\[${RESET}${GREEN}\]"
style_chars="\[${RESET}${WHITE}\]"
style_smiley="\[${RESET}${WHITE}\]"
style_branch_modified="\[${RESET}${RED}\]"
style_branch_added="\[${RESET}${GREEN}\]"
style_branch_clean="\[${RESET}${CYAN}\]"
# Set the terminal title to the current working directory
PS1="\[\033]0;\w\007\]"
# Build the prompt
PS1+="\[${style_user}\u\]" # Username
PS1+="\[${style_chars}:\]" # :
PS1+="\[${style_host}\h\]" # Host
# PS1+="${style_chars} > " # If you want a character instead of random smileys
PS1+="\[${style_path} \w\]" # Working directory
PS1+="\[${style_smiley}\] "
PS1+='\[${expressions[$RANDOM % ${#expressions[@]}]}\] '
PS1+='$(
if [[ $(__git_ps1) =~ \*\)$ ]]
# a file has been modified but not added
then echo "'${style_branch_modified}'"$(__git_ps1 "(%s)")
elif [[ $(__git_ps1) =~ \+\)$ ]]
# a file has been added, but not commited
then echo "'${style_branch_added}'"$(__git_ps1 "(%s)")
# the state is clean, changes are commited
else echo "'${style_branch_clean}'"$(__git_ps1 "(%s)")
fi)'
PS1+="\n" # new line
#PS1+="> \[${RESET}\]" # System cannot handle emojis
PS1+="🐘 💨 \[${RESET}\]" # Last character and reset (finally!)