# ~/.bashrc: executed by bash(1) for non-login shells. # # Part of the Adam pseudohome bundle: # AMLN McGreggor # Email: | web: # # $Id: .bashrc 437 2011-11-28 19:26:50Z adam $ # If not running interactively, do sweet fuck all: [ -z "$PS1" ] && return # don't put duplicate lines in the history. See bash(1) for more options export HISTCONTROL=ignoredups # vim! export EDITOR=vim # for gnupg.vim: export GPG_TTY=`tty` export PAGER=less # ~adam/bin/new uses these. export FULLNAME="Adam McGreggor" export MAILADDRESS=adam@amyl.org.uk export WEBADDRESS=http://blog.amyl.org.uk # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # enable color support of ls and also add handy aliases if [ "$TERM" != "dumb" ]; then # Debianistic OSes should handle this if [ -x /usr/bin/dircolors ]; then eval `dircolors -b` alias ls='ls --color=auto' #alias dir='ls --color=auto --format=vertical' #alias vdir='ls --color=auto --format=long' else # presume we're on BSD or something else: alias ls='ls -G' fi fi # and aliases from .bash_aliases, thanks if [ -f ~/.bash_aliases ] || [ -L ~/.bash_aliases ] ; then . ~/.bash_aliases fi # and aliases from .bash_aliases-local, thanks if [ -f ~/.bash_aliases-local ] || [ -L ~/.bash_aliases-local ] ; then . ~/.bash_aliases-local fi # machine aliases: if [ -f ~/.machine_aliases ]; then . ~/.machine_aliases fi # work out machine name/domain: # up. _M=$(hostname -f || hostname) if [ "$MACHINE" = "" ] ; then # Figure out which machine we are on. case $_M in *ukcod.org.uk*) MACHINE=ukcod ;; *amyl.org.uk*) MACHINE=amyl ;; *abeyance.org.uk*) MACHINE=abeyance ;; *no2id.*) MACHINE=no2id ;; *willcock*) MACHINE=no2id ;; plum.*) MACHINE=plum ;; *.unfortu.net) MACHINE=plum ;; *.openrightsgroup.*) MACHINE=org ;; *euroburners.*) MACHINE=euroburners ;; *int.gnl*) MACHINE=guardian ;; *rewiredstate.org) MACHINE=rws ;; esac fi # set a fancy prompt #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' # Comment in the above and uncomment this below for a color prompt PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' # set prompt colors/other machine specific things: if [ "$MACHINE" = "ukcod" ] ; then # purple PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' umask 0002 fi if [ "$MACHINE" = "amyl" ] ; then # white PS1='${debian_chroot:+($debian_chroot)}\[\033[01;37m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' fi if [ "$MACHINE" = "abeyance" ] ; then # red PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' fi if [ "$MACHINE" = "no2id" ] ; then # yellow PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' umask 0002 fi if [ "$MACHINE" = "plum" ] ; then # red PS1='[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]]\$ ' fi if [ "$MACHINE" = "org" ] || [ ${HOSTNAME} = "flummox.openrightsgroup.org" ] ; then # cyan PS1='[\033[01;36m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]]\$ ' umask 0002 fi if [ "$MACHINE" = "euroburners" ] ; then # blue PS1='${debian_chroot:+($debian_chroot)}\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' umask 0002 fi if [ "$MACHINE" = "guardian" ] ; then # red PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' unalias hend alias hend="ssh adam@hendricks.amyl.org.uk" fi if [ "$MACHINE" = "rws" ] ; then # red if [ "${HOSTNAME}" = "mt001.rewiredstate.org" ]; then PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin fi PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' umask 0002 fi # If this is an xterm set the title to user@host:dir case $TERM in xterm*|rxvt*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; *) ;; esac # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc). if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi