forked from sparks/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
170 lines (140 loc) · 5.88 KB
/
.bashrc
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#--------- Mac vs Non-Mac ENV Variables --------#
if [ `uname` == 'Darwin' ]; then
#Crosspack MAN Files
if [ -d /usr/local/CrossPack-AVR/man ]; then
export MANPATH=/usr/local/CrossPack-AVR/man:$MANPATH
fi
#ARM Compile Tools
if [ -d /usr/local/arm-cs-tools/bin ]; then
export PATH=/usr/local/arm-cs-tools/bin:$PATH
fi
#XTerm (Octave and GnuPlot)
export GNUTERM='x11'
#SVN diff/merge tool
if [ `command -v fmdiff` ]; then
export SVN_MERGE=fmdiff
fi
#Mac Aliases
if [ `command -v /Applications/EAGLE/EAGLE.app/Contents/MacOS/EAGLE` ]; then
alias eagle='/Applications/EAGLE/EAGLE.app/Contents/MacOS/EAGLE&'
fi
if [ `command -v subl` ]; then
alias s='subl'
fi
alias ls='ls -hlG'
alias l='ls -hlG'
alias la='ls -ahlG'
else
alias ls='ls -hl --color'
alias l='ls -hl --color'
alias la='ls -ahl --color'
fi
export EDITOR='vi'
export AVR_ISP='dragon_isp'
#--------- Homebrew stuff --------#
#Brew path settings (should be last to alter the PATH
export PATH=/usr/local/bin:$PATH
if [ `command -v brew` ]; then
#Brew path settings (should be last to alter the PATH
export PATH=/usr/local/share/python:/usr/local/sbin:$PATH
#Brew bash_completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
fi
# if [ -n "$TMUX" ]; then
# f(){ if [ "$PWD" != "$LPWD" ];then LPWD="$PWD"; tmux rename-window ${PWD//*\//}; fi }; export PROMPT_COMMAND=f;
# fi
#--------- Prompt --------#
function parse_git_dirty() {
if [ `command -v git` ]; then
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
fi
}
function parse_git_branch() {
if [ `command -v git` ]; then
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ \1$(parse_git_dirty)/"
fi
}
if [ `uname` == 'Darwin' -a `whoami` == 'sparky' ]; then
export PS1="\[\e[1;31m\][\[\e[0;37m\]\W\[\e[1;33m\]\$(parse_git_branch)\[\e[1;31m\]]\[\e[0m\] "
export PS2="\[\e[1:31m\] >\[\e[0m\] "
else
export PS1="\[\e[1;36m\][\[\e[0;37m\]\W\[\e[1;33m\]\$(parse_git_branch)\[\e[1;36m\]]\[\e[0m\] "
export PS2="\[\e[1:36m\] >\[\e[0m\] "
fi
#--------- Generic Aliases and Bash Stuff --------#
shopt -s cdspell
shopt -s nocaseglob
alias vi='vim'
alias ..='cd ..'
alias c='clear'
alias p='cd ~/Projects/'
#avrdude
if [ `command -v avrdude` ]; then
alias usbasp='avrdude -c usbasp -P usb'
alias usbtiny='avrdude -c usbtiny -P usb'
alias mk2='avrdude -c avrispmkII -P usb'
alias dragon='avrdude -c dragon_isp -P usb'
fi
#Screen
alias pirate='screen -t "BusPirate" /dev/tty.usbserial-A700e6Gc 115200'
#--------- ASCII Art --------#
alias cherry='echo " 8888 8888888
888888888888888888888888
8888:::8888888888888888888888888
8888::::::8888888888888888888888888888
88::::::::888:::8888888888888888888888888
88888888::::8:::::::::::88888888888888888888
888 8::888888::::::::::::::::::88888888888 888
88::::88888888::::m::::::::::88888888888 8
888888888888888888:M:::::::::::8888888888888
88888888888888888888::::::::::::M88888888888888
8888888888888888888888:::::::::M8888888888888888
8888888888888888888888:::::::M888888888888888888
8888888888888888::88888::::::M88888888888888888888
88888888888888888:::88888:::::M888888888888888 8888
88888888888888888:::88888::::M::;o*M*o;888888888 88
88888888888888888:::8888:::::M:::::::::::88888888 8
88888888888888888::::88::::::M:;:::::::::::888888888
8888888888888888888:::8::::::M::aAa::::::::M8888888888 8
88 8888888888::88::::8::::M:::::::::::::888888888888888 8888
88 88888888888:::8:::::::::M::::::::::;::88:88888888888888888
8 8888888888888:::::::::::M::\"@@@@@@@\"::::8w8888888888888888
88888888888:888::::::::::M:::::\"@a@\":::::M8i888888888888888
8888888888::::88:::::::::M88:::::::::::::M88z88888888888888888
8888888888:::::8:::::::::M88888:::::::::MM888!888888888888888888
888888888:::::8:::::::::M8888888MAmmmAMVMM888*88888888 88888888
888888 M:::::::::::::::M888888888:::::::MM88888888888888 8888888
8888 M::::::::::::::M88888888888::::::MM888888888888888 88888
888 M:::::::::::::M8888888888888M:::::mM888888888888888 8888
888 M::::::::::::M8888:888888888888::::m::Mm88888 888888 8888
88 M::::::::::::8888:88888888888888888::::::Mm8 88888 888
88 M::::::::::8888M::88888::888888888888:::::::Mm88888 88
8 MM::::::::8888M:::8888:::::888888888888::::::::Mm8 4
8M:::::::8888M:::::888:::::::88:::8888888::::::::Mm 2
88MM:::::8888M:::::::88::::::::8:::::888888:::M:::::M
8888M:::::888MM::::::::8:::::::::::M::::8888::::M::::M
88888M:::::88:M::::::::::8:::::::::::M:::8888::::::M::M
88 888MM:::888:M:::::::::::::::::::::::M:8888:::::::::M:
8 88888M:::88::M:::::::::::::::::::::::MM:88::::::::::::M
88888M:::88::M::::::::::*88*::::::::::M:88::::::::::::::M
888888M:::88::M:::::::::88@@88:::::::::M::88::::::::::::::M
888888MM::88::MM::::::::88@@88:::::::::M:::8::::::::::::::*8
88888 M:::8::MM:::::::::*88*::::::::::M:::::::::::::::::88@@
8888 MM::::::MM:::::::::::::::::::::MM:::::::::::::::::88@@
888 M:::::::MM:::::::::::::::::::MM::M::::::::::::::::*8
888 MM:::::::MMM::::::::::::::::MM:::MM:::::::::::::::M
88 M::::::::MMMM:::::::::::MMMM:::::MM::::::::::::MM
88 MM:::::::::MMMMMMMMMMMMMMM::::::::MMM::::::::MMM
88 MM::::::::::::MMMMMMM::::::::::::::MMMMMMMMMM
88 8MM::::::::::::::::::::::::::::::::::MMMMMM"'
alias truck='echo "
_,..=xxxxxxxxxxxx,
/L_Y.=\"\"\"\"\"\"\"\"\"\`,--n.
......... .--\"[=======]|| | []\\ .........
................ | _ _ || _ | ................
\"-(_)-(_)--------(_)--\"
"'
##### RUN COMMANDS BEFORE START #####
truck #draw a pretty picture