Mercurial > ec-dotfiles
annotate rc/bash @ 310:4b7b95cb6e09
Always use bookmarks for hg.
| author | Edho Arief <edho@myconan.net> | 
|---|---|
| date | Wed, 07 Mar 2012 19:14:40 +0700 | 
| parents | 592605e4d3bb | 
| children | dd2ddddf00d5 30ccb356a94a | 
| rev | line source | 
|---|---|
| 43 | 1 #!/usr/bin/env bash | 
| 2 | |
| 
242
 
ebfa844d2ef8
[bash] Also ensures interactive terminal.
 
Edho Arief <edho@myconan.net> 
parents: 
238 
diff
changeset
 | 
3 case "${-}" in | 
| 
 
ebfa844d2ef8
[bash] Also ensures interactive terminal.
 
Edho Arief <edho@myconan.net> 
parents: 
238 
diff
changeset
 | 
4 *i*) ;; | 
| 
 
ebfa844d2ef8
[bash] Also ensures interactive terminal.
 
Edho Arief <edho@myconan.net> 
parents: 
238 
diff
changeset
 | 
5 *) return;; | 
| 
 
ebfa844d2ef8
[bash] Also ensures interactive terminal.
 
Edho Arief <edho@myconan.net> 
parents: 
238 
diff
changeset
 | 
6 esac | 
| 
 
ebfa844d2ef8
[bash] Also ensures interactive terminal.
 
Edho Arief <edho@myconan.net> 
parents: 
238 
diff
changeset
 | 
7 | 
| 
117
 
548cf46e9cb4
Ensures no double loading using C-style variable test.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
112 
diff
changeset
 | 
8 if [ "${ECOS_BASH_LOADED}" != "yes" ]; then | 
| 
122
 
eacc854eae67
Export should be used since it inherited to subshell (eg. tmux). Also hasten exit instead of fi on the bottom of file.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
117 
diff
changeset
 | 
9 ECOS_BASH_LOADED="yes" | 
| 
 
eacc854eae67
Export should be used since it inherited to subshell (eg. tmux). Also hasten exit instead of fi on the bottom of file.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
117 
diff
changeset
 | 
10 else | 
| 
 
eacc854eae67
Export should be used since it inherited to subshell (eg. tmux). Also hasten exit instead of fi on the bottom of file.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
117 
diff
changeset
 | 
11 return | 
| 
 
eacc854eae67
Export should be used since it inherited to subshell (eg. tmux). Also hasten exit instead of fi on the bottom of file.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
117 
diff
changeset
 | 
12 fi | 
| 
117
 
548cf46e9cb4
Ensures no double loading using C-style variable test.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
112 
diff
changeset
 | 
13 | 
| 71 | 14 [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" | 
| 
49
 
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
 
Edho Prima Arief <me@myconan.net> 
parents: 
48 
diff
changeset
 | 
15 | 
| 67 | 16 _org_path="${PATH}" | 
| 62 | 17 export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" | 
| 
44
 
1f1af28f36e9
[bash] Bashrc, c-style ifdef.
 
Edho Prima Arief <me@myconan.net> 
parents: 
43 
diff
changeset
 | 
18 | 
| 
111
 
fd8dbd4bb758
ls color for freebsd, history control.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
106 
diff
changeset
 | 
19 shopt -s histappend | 
| 276 | 20 PROMPT_COMMAND="history -a" | 
| 
111
 
fd8dbd4bb758
ls color for freebsd, history control.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
106 
diff
changeset
 | 
21 export HISTFILESIZE=10000 | 
| 
 
fd8dbd4bb758
ls color for freebsd, history control.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
106 
diff
changeset
 | 
22 export HISTCONTROL=ignoredups | 
| 
 
fd8dbd4bb758
ls color for freebsd, history control.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
106 
diff
changeset
 | 
23 | 
| 296 | 24 export PAGER=more | 
| 
49
 
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
 
Edho Prima Arief <me@myconan.net> 
parents: 
48 
diff
changeset
 | 
25 export EDITOR=vi | 
| 
89
 
29bd7f6ef58a
Explicit LANG declaration.
 
Edho Prima Arief <me@myconan.net> 
parents: 
60 
diff
changeset
 | 
26 export LANG="en_US.UTF-8" | 
| 
267
 
e35a36bb832e
Always export LSCOLORS and CLICOLOR
 
Edho Arief <edho@myconan.net> 
parents: 
266 
diff
changeset
 | 
27 export CLICOLOR= | 
| 
 
e35a36bb832e
Always export LSCOLORS and CLICOLOR
 
Edho Arief <edho@myconan.net> 
parents: 
266 
diff
changeset
 | 
28 export LSCOLORS=ExGxFxdxCxegedabagExEx | 
| 307 | 29 export LS_COLORS= | 
| 
309
 
592605e4d3bb
Use SI whenever possible. Use 1KiB instead otherwise.
 
Edho Arief <edho@myconan.net> 
parents: 
308 
diff
changeset
 | 
30 export BLOCKSIZE=1K | 
| 
 
592605e4d3bb
Use SI whenever possible. Use 1KiB instead otherwise.
 
Edho Arief <edho@myconan.net> 
parents: 
308 
diff
changeset
 | 
31 export BLOCK_SIZE=si | 
| 
49
 
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
 
Edho Prima Arief <me@myconan.net> 
parents: 
48 
diff
changeset
 | 
32 | 
| 62 | 33 alias ls="ls -F" | 
| 34 alias rm="rm -i" | |
| 288 | 35 alias rd="rdesktop -g 1280x600 -K -a 15 -x m -z -P -r sound:off -r clipboard:CLIPBOARD -5" | 
| 
53
 
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
 
Edho Prima Arief <me@myconan.net> 
parents: 
52 
diff
changeset
 | 
36 | 
| 43 | 37 _has_gnu_ls= | 
| 
53
 
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
 
Edho Prima Arief <me@myconan.net> 
parents: 
52 
diff
changeset
 | 
38 _has_gnu_grep= | 
| 
238
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
39 _ls="ls" | 
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
40 _grep="grep" | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
41 _has_posix_grep=y | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
42 | 
| 43 | 43 case "$(uname -s)" in | 
| 44 Linux) | |
| 45 _has_gnu_ls=y | |
| 
96
 
26c9dc482051
Merge. Linux obviously has gnu grep.
 
Edho Prima Arief <edho@myconan.net> 
parents: 
75 
diff
changeset
 | 
46 _has_gnu_grep=y | 
| 43 | 47 ;; | 
| 48 SunOS) | |
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
49 _has_posix_grep=n | 
| 43 | 50 [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y | 
| 
53
 
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
 
Edho Prima Arief <me@myconan.net> 
parents: 
52 
diff
changeset
 | 
51 [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y | 
| 
253
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
52 # Higher priority directories | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
53 for i in {/opt/csw,/usr/gnu}/{,s}bin; do | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
54 [ -d "${i}" ] && PATH="${i}:${PATH}" | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
55 done | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
56 for i in /usr/{sfw,xpg4}/bin; do | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
57 [ -d "${i}" ] && PATH="${PATH}:${i}" | 
| 
 
e6de49d70fe7
(Not so) simplified solaris path add.
 
Edho Arief <edho@myconan.net> 
parents: 
252 
diff
changeset
 | 
58 done | 
| 
57
 
ada5b9534765
[bash] Sanitize sunos ping.
 
Edho Prima Arief <me@myconan.net> 
parents: 
56 
diff
changeset
 | 
59 alias ping="ping -s" | 
| 
 
ada5b9534765
[bash] Sanitize sunos ping.
 
Edho Prima Arief <me@myconan.net> 
parents: 
56 
diff
changeset
 | 
60 alias ping6="ping -A inet6" | 
| 265 | 61 # Hello tmux. Perhaps one day we'll have title with dtterm. | 
| 
268
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
62 # But for now we work this around by prepending tmux call with xterm-256color | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
63 # which hopefully exists. Otherwise we have to live with no title. | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
64 if [ -f /usr/share/lib/terminfo/x/xterm-256color ]; then | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
65 alias tmux="TERM=xterm-256color tmux" | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
66 else | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
67 echo "No xterm-256color, using dtterm. Tmux title won't work." | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
68 fi | 
| 
 
feab84a8efdb
Merge. Also more workaround for Solaris tmux.
 
Edho Arief <edho@myconan.net> 
diff
changeset
 | 
69 [ -f /usr/share/lib/terminfo/?/"${TERM}" ] || export TERM=dtterm | 
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
70 if command -v ggrep > /dev/null 2>&1; then | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
71 _has_gnu_grep=y | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
72 _grep="ggrep" | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
73 fi | 
| 272 | 74 if command -v gls > /dev/null 2>&1; then | 
| 75 _has_gnu_ls=y | |
| 76 _ls="gls" | |
| 77 fi | |
| 43 | 78 ;; | 
| 275 | 79 FreeBSD) | 
| 80 # Invalid characters when using en_US.UTF-8. | |
| 81 alias man="man -o" | |
| 278 | 82 # Multi CPU awesomeness. | 
| 83 alias top="top -P" | |
| 275 | 84 ;; | 
| 62 | 85 OpenBSD) | 
| 255 | 86 PATH="${PATH}:/usr/X11R6/bin" | 
| 
238
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
87 if command -v gls > /dev/null 2>&1; then | 
| 
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
88 _has_gnu_ls=y | 
| 
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
89 _ls="gls" | 
| 
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
90 elif command -v colorls > /dev/null 2>&1; then | 
| 276 | 91 alias ls="colorls -F" | 
| 62 | 92 fi | 
| 93 ;; | |
| 249 | 94 NetBSD) | 
| 255 | 95 PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin" | 
| 249 | 96 if command -v gls > /dev/null 2>&1; then | 
| 97 _has_gnu_ls=y | |
| 98 _ls="gls" | |
| 99 elif command -v colorls > /dev/null 2>&1; then | |
| 276 | 100 alias ls="colorls -F" | 
| 249 | 101 fi | 
| 102 ;; | |
| 67 | 103 CYGWIN*) | 
| 104 export PATH="${PATH}:${_org_path}" | |
| 105 ;; | |
| 43 | 106 esac | 
| 107 | |
| 
238
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
108 [ "${_has_gnu_ls}" = y ] && alias ls="${_ls} -F --color=auto" | 
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
109 if [ "${_has_gnu_grep}" = y ]; then | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
110 alias grep="${_grep} --color=auto" | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
111 _has_posix_grep=y | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
112 fi | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
113 if [ "${_has_posix_grep}" = y ]; then | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
114 alias fgrep="grep -F" | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
115 alias egrep="grep -E" | 
| 
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
116 fi | 
| 
53
 
b9db5d89aae3
[bash] POSIX grep, GNU grep, standardized quote (" unless ' required).
 
Edho Prima Arief <me@myconan.net> 
parents: 
52 
diff
changeset
 | 
117 | 
| 
49
 
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
 
Edho Prima Arief <me@myconan.net> 
parents: 
48 
diff
changeset
 | 
118 unset _has_gnu_ls | 
| 58 | 119 unset _has_gnu_grep | 
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
120 unset _has_posix_grep | 
| 
238
 
5dcbf6ab0109
Prioritize gnuls over colorls on OpenBSD. Modified GNU ls alias to allow different executable name.
 
Edho Arief <edho@myconan.net> 
parents: 
141 
diff
changeset
 | 
121 unset _ls | 
| 
270
 
0e41725e7d38
Grep, GNU Grep, Solaris Grep, etc.
 
Edho Arief <edho@myconan.net> 
parents: 
269 
diff
changeset
 | 
122 unset _grep | 
| 
49
 
b924652e169d
[bash] Various tweaks: prompt, unset for check variables, etc
 
Edho Prima Arief <me@myconan.net> 
parents: 
48 
diff
changeset
 | 
123 | 
| 261 | 124 # Custom application I usually install and safe to prioritize | 
| 125 for i in {"${HOME}/app","/opt"}/{tmux,ruby19,node,tarsnap,symon,nginx}/{bin,sbin}; do | |
| 126 [ -d "${i}" ] && PATH="${i}:${PATH}" | |
| 127 done | |
| 304 | 128 # New(?) rubygems bin PATH | 
| 129 for i in {"${HOME}/app","/opt"}/ruby19/lib/ruby/gems/1.9.1/bin; do | |
| 130 [ -d "${i}" ] && PATH="${i}:${PATH}" | |
| 131 done | |
| 261 | 132 | 
| 
264
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
133 # MySQL in common locations highest priority since new = better. Also no compatibility problem. | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
134 # Cluster is superset of Enterprise/GPL so it gets highest priority. | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
135 # And use only one. | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
136 for mydir in {"${HOME}",/app{,s},/opt}/mysql/{{cluster,enterprise}/mysql/,}bin; do | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
137 if [ -d "${mydir}" ]; then | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
138 PATH="${mydir}:${PATH}" | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
139 break | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
140 fi | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
141 done | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
142 | 
| 261 | 143 # Mercurial is optional since it will be inconsistent with ssh ... hg if this one gets priority. | 
| 
264
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
144 # And use only one. | 
| 
281
 
87ce8cfdb8d4
Alias for newer hg. Also more search path.
 
Edho Arief <edho@myconan.net> 
parents: 
279 
diff
changeset
 | 
145 for hgdir in {"${HOME}/app","/opt"}/mercurial{,/bin}; do | 
| 
 
87ce8cfdb8d4
Alias for newer hg. Also more search path.
 
Edho Arief <edho@myconan.net> 
parents: 
279 
diff
changeset
 | 
146 hgbin="${hgdir}/hg" | 
| 
 
87ce8cfdb8d4
Alias for newer hg. Also more search path.
 
Edho Arief <edho@myconan.net> 
parents: 
279 
diff
changeset
 | 
147 if [ -x "${hgbin}" ]; then | 
| 
264
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
148 PATH="${PATH}:${hgdir}" | 
| 
281
 
87ce8cfdb8d4
Alias for newer hg. Also more search path.
 
Edho Arief <edho@myconan.net> 
parents: 
279 
diff
changeset
 | 
149 alias nhg="${hgbin}" | 
| 
264
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
150 break | 
| 
 
c6c322c57e0e
Paths for MySQL, instabreak for mercurial.
 
Edho Arief <edho@myconan.net> 
parents: 
262 
diff
changeset
 | 
151 fi | 
| 261 | 152 done | 
| 
56
 
9343fa4dfd91
[bash] we have vim. Probably.
 
Edho Prima Arief <me@myconan.net> 
parents: 
55 
diff
changeset
 | 
153 | 
| 
273
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
154 for supbindir in {"${HOME}/app","/opt"}/supervisor{,d}/bin; do | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
155 if [ -d "${supbindir}" ]; then | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
156 PATH="${PATH}:${supbindir}" | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
157 break | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
158 fi | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
159 done | 
| 
 
cf23a637f3a5
Supervisor support. Added on last since I usually install it in virtualenv
 
Edho Arief <edho@myconan.net> 
parents: 
271 
diff
changeset
 | 
160 | 
| 59 | 161 case "${TERM}" in | 
| 
254
 
dde04581a2bf
Combined PS1 and PROMPT_COMMAND conditional.
 
Edho Arief <edho@myconan.net> 
parents: 
253 
diff
changeset
 | 
162 xterm*|screen*|dtterm*) | 
| 
271
 
003b0c8870b3
As it turns out who am i doesn't respect current actual user. Replaced with ancient but better version. Either LOGNAME or USER. Whichever has value.
 
Edho Arief <edho@myconan.net> 
parents: 
270 
diff
changeset
 | 
163 PROMPT_COMMAND='echo -ne "\033]0;'"${USER:-$LOGNAME}@$(uname -n)"': ${PWD}\007";'"${PROMPT_COMMAND}" | 
| 
254
 
dde04581a2bf
Combined PS1 and PROMPT_COMMAND conditional.
 
Edho Arief <edho@myconan.net> 
parents: 
253 
diff
changeset
 | 
164 PS1='[\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\] \[\e[1;34m\]\W\[\e[0m\]]\$ ' | 
| 
 
dde04581a2bf
Combined PS1 and PROMPT_COMMAND conditional.
 
Edho Arief <edho@myconan.net> 
parents: 
253 
diff
changeset
 | 
165 ;; | 
| 
 
dde04581a2bf
Combined PS1 and PROMPT_COMMAND conditional.
 
Edho Arief <edho@myconan.net> 
parents: 
253 
diff
changeset
 | 
166 *) | 
| 
 
dde04581a2bf
Combined PS1 and PROMPT_COMMAND conditional.
 
Edho Arief <edho@myconan.net> 
parents: 
253 
diff
changeset
 | 
167 PS1='[\u@\h \W]\$ ' | 
| 59 | 168 ;; | 
| 169 esac | |
| 170 | |
| 
63
 
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
 
Edho Prima Arief <me@myconan.net> 
parents: 
62 
diff
changeset
 | 
171 if command -v vim > /dev/null 2>&1; then | 
| 
 
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
 
Edho Prima Arief <me@myconan.net> 
parents: 
62 
diff
changeset
 | 
172 alias vi=vim | 
| 
 
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
 
Edho Prima Arief <me@myconan.net> 
parents: 
62 
diff
changeset
 | 
173 export EDITOR=vim | 
| 
 
b7814634220a
[bash] branch merge, added EDITOR change to vim when detected.
 
Edho Prima Arief <me@myconan.net> 
parents: 
62 
diff
changeset
 | 
174 fi | 
| 266 | 175 | 
| 296 | 176 if command -v less > /dev/null 2>&1; then | 
| 177 alias less="less -Rins" | |
| 178 export PAGER="less -Rins" | |
| 179 fi | |
| 180 | |
| 266 | 181 rm -If "/tmp/.nonexistent.$(date '+%Y%m%d%H%M%S')" 2> /dev/null && alias rm="rm -I" | 
| 182 | |
| 71 | 183 [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after" | 
