# -*- mode: shell-script -*- # .bashrc # Source global definitions if [ -r /etc/bashrc ]; then . /etc/bashrc fi [ -f /home/antocuni/.settings ] && . /home/antocuni/.settings if [[ $- != *i* ]] ; then # Shell is non-interactive. Be done now! return fi # ===================== # bash completion # ===================== if [ -f /etc/profile/bash-completion ] # for gentoo then source /etc/profile.d/bash-completion elif [ -f /etc/bash_completion ] then source /etc/bash_completion fi # ================ # Aliases # ================ function check() { which $1 &> /dev/null } # change the default arguments of some commands alias ls="ls -F --color=auto -B -I '*.pyc' -I '*.pyo'" alias lls='/bin/ls --color=auto -F' alias findpy="find ./ -name '*.py'" check pydf && alias df='pydf' check monodoc && alias monodoc='/usr/bin/monodoc > /dev/null 2>&1 &' alias mcd='mount /mnt/cdrom' alias ucd='umount /mnt/cdrom' alias musb='mount /mnt/usb' alias uusb='umount /mnt/usb' [ -d ~/pypy/user/arigo ] && alias rm="~/pypy/user/arigo/hack/bin/atomic_rm.py" alias fs="dropbox filestatus ~/Dropbox/antocuni/{.mozilla,.thunderbird}" alias lstree='find . -name .svn -prune -o -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"' if [ `hostname` == viper ] then #alias python2.5='/opt/python2.5/bin/python' alias pythonnet='mono /home/antocuni/opt/pythonnet2/python.exe' alias pywin='PYTHONPATH= wine /home/antocuni/.wine/drive_c/Python25/python.exe' alias py.test.net='pythonnet `which py.test`' alias py.test.net.hack='mono /home/antocuni/opt/pythonnet2-hacked/python.exe `which py.test`' alias py.test2.5='python2.5 `which py.test`' alias py.py.net='pythonnet `which py.py` --withmod-clr' # alias ipy='mono /home/antocuni/IronPython-2.0.1/ipy.exe -X:TabCompletion' # alias ipy10='mono /home/antocuni/IronPython-1.0.1/ipy.exe -X:TabCompletion' # alias sqlite3="LD_LIBRARY_PATH=/home/antocuni/lib /usr/bin/sqlite3" alias latexmk='/home/antocuni/latexmk/latexmk.pl' fi unset -f check # ============= # PROMPT # ============= # show the username only if it's not root or antocuni if [ "$USER" != antocuni ] && [ "$USER" != root ] then U="\u@" fi case $USER--`hostname` in root--*) HCOL=31 ;; # red *--viper) HCOL=33 ;; # yellow *--viper2) HCOL=32 ;; # green *--anaconda) HCOL=32 ;; # green *--wyvern) HCOL=35 ;; # magenta *--tannit) HCOL=35 ;; # blue *--cobra) HCOL=32 ;; # green *--code0.codespeak.net) HCOL=34 ;; # blue *) HCOL=37 ;; # white esac # if we are inside the 32bit chroot, show it in the prompt if [ -f /etc/32bit ] then P32="/32" fi if [ "$TERM" = "emacs" ] || [ "$TERM" = "dumb" ] then export PS1="${U}${P32}\h \W \$ " else export PS1="\[\033[01;${HCOL}m\]${U}\h\[\033[01;32m\]${P32} \[\033[01;36m\]\W \[\033[01;34m\]\$ \[\033[00m\]" fi unset U unset HCOL # =========== # PATHS # =========== case `file /bin/bash` in *64?bit*) LOCAL=~/local/64 ;; *) LOCAL=~/local/32 esac export LD_LIBRARY_PATH="$LOCAL/lib" export PATH="$LOCAL/bin:$PATH" if [ -d ~/pypy/misc/root ] then export ROOTSYS="/home/antocuni/pypy/misc/root" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ROOTSYS/lib" fi # ============================= # dircolors & xterm title # ============================= # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 if [[ -f ~/.dir_colors ]]; then eval `dircolors -b ~/.dir_colors` elif [[ -f /etc/DIR_COLORS ]]; then eval `dircolors -b /etc/DIR_COLORS` fi if [ "$TERM" != "emacs" ] && [ "$TERM" != "dumb" ] && [ "$TERM" != "linux" ] then . /home/antocuni/pypy/user/antocuni/etc/scripts/preexec.bash.sh preexec_xterm_title_install fi # ======================= # virtualenvwrapper # ======================= if [ -f /usr/local/bin/virtualenvwrapper.sh ] then export WORKON_HOME=~/Envs mkdir -p $WORKON_HOME source /usr/local/bin/virtualenvwrapper.sh fi # ================================== # disable XON/XOFF flow-conrol # ================================== stty -ixon # ==================================== # start bash-dirhist, if present # ==================================== case $0 in *bash-dirhist) # we are already running bash-dirhist, nothing to do ;; *) # try to run bash-dirhist if [ -f $LOCAL/bin/bash-dirhist ] then exec $LOCAL/bin/bash-dirhist fi ;; esac