# ~/.bashrc: executed by bash(1) for non-login shells. -*-sh-*- PATH=~/bin:~/sw/bin:/usr/local/bin:/opt/xc/bin:$PATH LOCALRC=~/dot/bashrc.`hostname -s` # shopt -s histappend # Don't ever delete history # export PROMPT_COMMAND="history -n; history -a" # Read/write history at every new prompt. if [ -f "$LOCALRC" ]; then # echo sourcing $LOCALRC source $LOCALRC fi if [ `uname` == Darwin ]; then PATH=/sw/bin:/usr/X11R6/bin:/plt/bin:$PATH # if [ $TERM == rxvt-unicode ]; then # export TERM=xterm-color # fi # else # the 'make local' hack doesn't work on darwin # PATH=~/build/packetforth/bin:$PATH fi # If running interactively.. if [ "$PS1" ]; then if [ "$TERM" == dumb ]; then export COLUMNS=80 fi ## xmodmap no effect in ~/.xinitrc? (Was: hack Xorg 7.3 bug) if [ "$DISPLAY" == :0.0 ]; then # ~/bin/Xmodmap.sh >/dev/null # xrdb ~/.Xdefaults # xmodmap ~/dot/Xmodmap.ctrl echo -n fi if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' . ~/.alias # probably means we're in emacs. the $EMACS var doesnt get exported over ssh. if [ "$TERM" == dumb ]; then . ~/.emacs_alias else [ -f /etc/bash_completion ] && echo -n #/etc/bash_completion fi # homedir hack if [ `pwd` == "/data/disk1/home/tom" ]; then cd /home/tom fi # screen hacks if [ $TERM == "screen.linux" ]; then PS1="($WINDOW) $PS1" fi # motd cat ~/.motd fi # Get keychain agent vars. source_kc () { [ -f "$1" ] && . $1 # && echo "keychain source: $1" } source_kc ~/.keychain/$HOSTNAME-sh source_kc ~/.keychain/$HOSTNAME-sh-gpg # if there's no forwarded agent, then source keychain env vars # if [ -z "$SSH_AGENT_PID" ]; then # . ~/.keychain/$HOSTNAME-sh # fi # if there's not display, guess it by checking from where we logged in. if [ -z "$DISPLAY" ]; then GUESSED=`who -m --ips | awk '{print $5 }'` if [ -n "$GUESSED" ]; then # Just store the value. Just sending X packets might # interfere with aggressive firewall. export _DISPLAY="$GUESSED:0.0" echo "DISPLAY not set. Guess stored in _DISPLAY=$_DISPLAY" fi fi # export variables export PATH # export EDITOR="editor" export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH export LC_CTYPE=en_US.UTF-8 export CLASSPATH=.:$CLASSPATH # To make java apps work correctly under Xmonad (avoid grey blobs). export _JAVA_AWT_WM_NONREPARENTING=1 umask 022 # https://github.com/rupa/z . ~/bin/z.sh # Git branch info parse_git_branch() { BRANCH=$(git name-rev --name-only HEAD 2>/dev/null) [ -z "$BRANCH" ] || echo "[$BRANCH] " } PS1="\$(parse_git_branch)$PS1"