1  # Function to help us manage paths
  2
  3  pathman () {
  4          if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
  5                  if [ "$2" = "last" ] ; then
  6                          PATH=$PATH:$1
  7                  else
  8                          PATH=$1:$PATH
  9                  fi
 10          fi
 11  }
 12
 13  # Add to the standard path.
 14  PATH=/bin:/usr/bin:/usr/local/bin
 15
 16  if [ $(id -u) = 0 ] ; then
 17          if [ -d "/usr/local/sbin" ] ; then
 18                  pathman /usr/local/sbin last
 19          fi
 20          if [ -d "/usr/sbin" ] ; then
 21                  pathman /usr/sbin last
 22          fi
 23          if [ -d "/sbin" ] ; then
 24                  pathman /sbin last
 25          fi
 26  fi
 27  if [ -d "/usr/X11R6/bin" ] ; then
 28          pathman /usr/X11R6/bin last
 29  fi
 30  JAVA_HOME=/opt/j2sdk/j2sdk
 31  if [ -d "$JAVA_HOME/bin" ] ; then
 32          pathman $JAVA_HOME/bin last
 33  fi
 34  if [ -d "/opt/gnome/bin" ] ; then
 35          pathman /opt/gnome/bin last
 36  fi
 37  if [ -d "/opt/kde/bin" ] ; then
 38          pathman /opt/kde/bin last
 39  fi
 40  if [ -d "/opt/bin" ] ; then
 41          pathman /opt/bin last
 42  fi
 43  if [ -d "$HOME/bin" ] ; then
 44          pathman $HOME/bin last
 45  fi
 46
 47  # Setup some environment variables.
 48  HISTSIZE=700
 49  PS1="[\u@\h \w]\\$ "
 50
 51  # Setup the INPUTRC environment variable.
 52  if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
 53          INPUTRC=/etc/inputrc
 54  fi
 55
 56
 57  # Setup for /bin/ls to support color, the alias is in /etc/bashrc.
 58  if [ -f "/etc/dircolors" ] ; then
 59          eval $(dircolors -b /etc/dircolors)
 60
 61          if [ -f "$HOME/.dircolors" ] ; then
 62                  eval $(dircolors -b $HOME/.dircolors)
 63          fi
 64  fi
 65
 66  pskill()
 67  {
 68      local pid
 69      exec 3<&0
 70
 71      ps ax | gawk '{ print $1, $5 }' | grep $1 | grep -v grep | \
 72      while read line;
 73      do
 74          pid=$(echo $line | gawk '{ print $1 }')
 75          echo -n "$(echo $line | gawk '{ print $1, "   " , $2 }')"  
 76          read -p "  Killing (*/n): "  <&3
 77          case $REPLY in
 78              [nN] ) break ;;
 79                 * )  kill -9 $pid
 80                      if  ps ax | grep -e "^ *${pid}" > /dev/null  ; then
 81                         echo "sorry, process is still there"
 82                      else
 83                         echo "     process got slaughtered"
 84                      fi
 85                      ;;
 86          esac
 87      done
 88      exec 0<&3
 89      exec 3>&-
 90  }
 91
 92  PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/lib/pkgconfig
 93  PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/opt/gnome/lib/pkgconfig
 94  PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/lib/pkgconfig:/usr/local/lib/pkgconfig
 95  GNOME_LIBCONFIG_PATH=/usr/lib
 96  GNOME_PREFIX=/usr
 97  QTDIR=/opt/qt
 98
 99  NNTPSERVER=127.0.0.1
100
101  CFLAGS="-g  -march=athlon-xp"
102  CXXFLAGS=$CFLAGS
103
104  TZ='Europe/Zurich'
105
106  EDITOR='Eterm -g 90x40 -t blank -e vim'
107  set -o vi
108
109  HTML_TIDY=~/.tidy.conf
110
111  CDPATH=.:/home/calmar/www/
112  HISTIGNORE="&:ls:la:l:ll:mutt:[bf]g:exit"
113  MAILCHECK=20
114  MAILCHECK=~/.mail/inbox:~/.mail/calmar:~/.mail/spam'?neue mails in ${_##*/}'
115
116  export LC_CTYPE=de_DE
117
118  export PATH HISTSIZE HISTIGNORE PS1 LS_COLORS INPUTRC QTDIR GNOME_PREFIX GNOME_LIBCONFIG_PATH
119  export PKG_CONFIG_PATH NNTPSERVER CFLAGS CXXFLAGS TZ  JAVA_HOME EDITOR
120  export HTML_TIDY
121  export CVSUMASK=003
122  export LFS=/mnt/lfs
123  export CVSROOT=:pserver:cvs@localhost:/var/cvs
124  #export CVSROOT=/var/cvs
125  export CDPATH HISTIGNORE MAILCHECK
126  export PYTHONSTARTUP=/home/calmar/.pystartup
127  shopt -s cdspell cmdhist extglob
128
129  # By default we want the umask to get set.
130  # Even for non-interactive and non-login shells.
131
132  function cpcd(){
133          tmp=$*
134          dest=${tmp##* }
135          files=${tmp% *}
136          cp $files $dest
137          cd $dest
138  }
139
140  function mvcd(){
141          tmp=$*
142          dest=${tmp##* }
143          files=${tmp% *}
144          mv $files $dest
145          cd $dest
146  }
147
148  function big(){
149          # finds (25 or $1th) largest files in cwd
150          find ${2:-"."} -xdev -maxdepth ${3:-4} -printf "%s %p\n" | sort -k1 -rn | head -n ${1:-25}
151  }
152
153
154  if [ "$(id -gn)" = "$(id -un)" -a $(id -u) -gt 99 ] ; then
155          umask 002
156  else
157          umask 022
158  fi
159  # Provides a colored /bin/ls command.  Used in conjunction with code in
160  # /etc/profile.
161  alias ls='ls -F -h --color=auto'
162  alias  l='ls -F -h --color=auto'
163  alias ll='ls -l -h -F --color=auto'
164  alias la='ls -all -h -F --color=auto'
165  #alias slrn='rxvt -geometry 100x40 -e slrn'
166  alias v='vim'
167  alias vv='gvim'
168  alias gvim='gvim -geometry 100x40';
169  alias x='startx'
170  alias emutt='Eterm -t cmutt'
171  alias et='Eterm -t blank -g 80x40'
172  alias gimp='gimp-2.1'
173  alias aoeu="xmodmap $HOME/keyboards/keyboard.default"
174  alias asdf="xmodmap $HOME/keyboards/keysym.dvorak"
175  alias avidemux="avidemux2 --audio-process --video-process --codec-conf Xvid --video-conf cbr=500"
176  alias xine="xine --loop"
177  alias gqview="gqview  ."
178  if [ "$(ps ax | grep 'xinit /home/calmar/.xinitrc')"  = "" ] ; then startx; fi
179