1 # ~/.bashrc: executed by bash(1) for non-login shells.
2 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
5 # If running interactively, then:
8 # don't put duplicate lines in the history. See bash(1) for more options
9 export HISTCONTROL=ignoredups
10 if [ -x ~/bin/sane_editor ]; then
11 EDITOR=~/bin/sane_editor;
12 elif [ -x /usr/bin/jed ]; then
13 EDITOR="/usr/bin/jed";
14 elif [ -x /usr/bin/vi ]; then
18 if [ -n "$EDITOR" ]; then
23 if [ -e bin/faf ]; then
24 complete -F _command faf
27 export DEBEMAIL="don@debian.org"
28 export DEBHOME="$(eval 'echo' '~/projects/debian')"
30 # enable color support of ls and also add handy aliases
32 alias ls='ls --color=auto'
33 alias gr='gimp-remote'
34 alias emc='sane_editor'
36 alias svn-b="svn-buildpackage --svn-builder 'pdebuild --buildresult ..' --svn-ignore-new"
39 #printf '\33]2;%s\007'
41 # See if we're in a chroot
42 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
43 debian_chroot=$(cat /etc/debian_chroot)
46 # we want to set the color based on what machine we're on
47 # if it's a remote, SSH_CONNECTION will be set
48 # set variable identifying the chroot you work in (used in the prompt below)
50 if [ -n "$SSH_CONNECTION" -o -n "$SSH_CLIENT" ]; then
51 # figure out what color to use
52 COLOR=$(hostname|md5sum|perl -ne 'if (/^([a-f\d]{8})/) {
53 my $num = unpack(q(L),pack(q(H*),$1));
54 my @col = map {(qq(0;${_}m),qq(1;${_}m))} 31..37;
55 my $col = $col[$num % @col];
56 if ($col eq q(0;36m)) {
61 PS1="${debian_chroot:+($debian_chroot)}\[\033[$COLOR\]\h \[\033[0;36m\]\t \w$\[\033[0m\] "
64 PS1="${debian_chroot:+($debian_chroot)}\[\033[0;36m\]\h \t \w$\[\033[0m\] "
66 # \[\033[1;36m\][\w]\n\[\033[0;36m\][\h|\t]$ \[\033[0m\]
68 # make sure the term we're using exists in the termcap
70 if ! toe $TOEOPT >/dev/null 2>&1; then
73 if ! toe $TOEOPT|grep -q "^$TERM "; then
74 # if it doesn't, try to switch
87 # If this is an xterm set the title to user@host:dir
90 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
93 PROMPT_COMMAND='echo -ne "\033]2;${USER}@${HOSTNAME}: ${PWD}\007"'
100 # enable programmable completion features (you don't need to enable
101 # this, if it's already enabled in /etc/bash.bashrc).
102 if [ -f /etc/bash_completion ]; then
103 . /etc/bash_completion;
107 if which ssh-agent >/dev/null && [ -d ~/.ssh ] && \
108 [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
110 if [ -e ~/.ssh/ssh_agent_info ] && \
111 [ -n "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)" ] && \
112 kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)" >/dev/null 2>&1; then
113 . ~/.ssh/ssh_agent_info > /dev/null
114 elif [ -e ~/.ssh/ssh_agent_info_$(hostname) ] && \
115 kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info_$(hostname))" >/dev/null 2>&1; then
116 . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null
118 ssh-agent -s > ~/.ssh/ssh_agent_info_$(hostname)
119 . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null
123 alias aumix2='aumix -d /dev/mixer1 -I'
124 if locale -a |grep -qi en_US.utf8; then
131 # If we're running on liszt, include /var/list/.bin in the path
132 if [ "$(hostname)" == "liszt" ] && [ -d /var/list/.bin ]; then
133 PATH="/var/list/.bin:$PATH"
135 export PATH="$(getent passwd $(id -u)|awk -F: '{print $6}')/bin:$PATH"
137 if [ ! -e ~/tmp ]; then
140 export TMPDIR="$(echo ~/tmp)";
142 if [ -n "$(which devtodo)" ]; then
143 for a in tda tdd tde; do
144 alias "s${a}"="STODO_NO_COMMIT=1 $a"
147 TODO_OPTIONS="--timeout --summary"
151 # use pushd instead of cd
152 if [ -z "$1" ] || [ "$1" == "-" ]; then
153 builtin cd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS};
155 builtin pushd "$@" >/dev/null && [ -r .todo ] && devtodo ${TODO_OPTIONS};
161 builtin pushd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS}
166 builtin popd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS}
169 # Run todo initially upon login
170 devtodo ${TODO_OPTIONS}