-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
60 lines (43 loc) · 1.33 KB
/
.bash_profile
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
# .bash_profile
# Get the aliases and functions
test -r ~/.bashrc && . ~/.bashrc
# User specific environment and startup programs
export PATH=$PATH:$HOME/bin
# See http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/
# See http://serverfault.com/questions/226783/how-to-tell-gnu-screen-to-run-bash-profile-in-each-new-window
# Use 'shell -$SHELL' in ~/.screenrc to make screen load ~/.bash_profile
set_prompt () {
LastStatus=$? # Must come first!
ORANGE='\[\e[38;5;196m\]'
BRED='\[\e[1;31m\]'
RED='\[\e[0;31m\]'
Red='\[\e[01;31m\]'
BGREEN='\[\e[1;32m\]'
GREEN='\[\e[0;32m\]'
BBLUE='\[\e[1;34m\]'
BLUE='\[\e[0;34m\]'
Blue='\[\e[01;34m\]'
DarkBlue='\[\e[01;32m\]'
WHITE='\[\e[01;37m\]'
NORMAL='\[\e[00m\]'
FancyX='\342\234\227'
Checkmark='\342\234\223'
PS1="\n"
[[ $LastStatus == 0 ]] && \
PS1+="$GREEN$Checkmark" || \
PS1+="$RED$FancyX$LastStatus"
# Job count
PS1+=" ${Blue}\j"
# If root, just print the host in red. Otherwise, print the current user
# and host.
[[ $EUID == 0 ]] && \
PS1+=" ${RED}@\h" || \
PS1+=" ${BLUE}\u${DarkBlue}@${Blue}\h"
# HH:MM and history index
PS1+=" ${GREEN}\A #\!"
# [$PWD] with newline
PS1+=" ${Blue}[${DarkBlue}\w${Blue}]\n"
# Set GNU Screen's window title
#PS1+="\[\ek${HOSTNAME%%.*}\e\\\\\]"
PS1+="${Red}\$${NORMAL} "
}; PROMPT_COMMAND='set_prompt'