-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_custom
80 lines (75 loc) · 3.73 KB
/
bash_custom
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
function ssh {
if [ $1 ]; then
/usr/bin/ssh -t $1 $2 $3 $4 "if [ -x /usr/bin/cur1 ]; then curl -k -s https://raw.github.com/fboyd78/bashcustom/master/bash_custom > /tmp/bash_custom; else wget --no-check-certificate -q https://raw.github.com/fboyd78/bashcustom/master/bash_custom -O /tmp/bash_custom; fi; bash --rcfile /tmp/bash_custom -i; rm -f /tmp/bash_custom >/dev/null 2>&1"
fi
}
LI1=`tty|cut -d/ -f3`
LI2=`tty|cut -d/ -f4`
function blue {
COLOR1="\[\033[0;34m\]"
COLOR2="\[\033[1;34m\]"
COLOR3="\[\033[0;37m\]"
COLOR4="\[\033[0;32m\]"
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
function cyan {
COLOR1="\[\033[0;36m\]"
COLOR2="\[\033[1;36m\]"
COLOR3="\[\033[0;37m\]"
COLOR4="\[\033[0;32m\]"
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
function green {
COLOR1="\[\033[0;32m\]"
COLOR2="\[\033[1;32m\]"
COLOR3="\[\033[0;37m\]"
COLOR4="\[\033[0;32m\]"
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
function magenta {
COLOR1="\[\033[0;35m\]"
COLOR2="\[\033[1;35m\]"
COLOR3="\[\033[0;37m\]"
COLOR4="\[\033[0;32m\]"
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
function red {
COLOR1="\[\033[0;31m\]"
COLOR2="\[\033[1;31m\]"
COLOR3="\[\033[0;37m\]"
COLOR4="\[\033[0;32m\]"
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
function white {
COLOR1="\[\033[0;37m\]" # Dark White
COLOR2="\[\033[1;37m\]" # Bright White
COLOR3="\[\033[0;37m\]" # Grey
COLOR4="\[\033[0;32m\]" # Green
COLOR9="\[\033[0m\]"
PS1="$COLOR3-$COLOR1-$COLOR2($COLOR3\u$COLOR4@$COLOR3\h$COLOR2)$COLOR1-$COLOR2($COLOR3$LI1$COLOR4/$COLOR3$LI2$COLOR2)$COLOR1-$COLOR2($COLOR3\$(date +%I:%M%P)$COLOR4:$COLOR3\$(date +%m/%d/%y)$COLOR2)$COLOR1-$COLOR3-$COLOR4\n$COLOR3-$COLOR1-$COLOR2($COLOR3\$$COLOR4:$COLOR3\w$COLOR2)$COLOR1-$COLOR3-$COLOR9 "
PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR9 "
}
rand() {
printf $(( $1 * RANDOM / 32767 ))
}
rand_element () {
local -a th=("$@")
unset th[0]
printf $'%s\n' "${th[$(($(rand "${#th[*]}")+1))]}"
}
$(rand_element blue cyan green magenta red white)
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias ls='ls -XF --color=auto'
export TERM=xterm