#! /opt/local/bin/bash

. /etc/profile

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH=$PATH:/usr/X11R6/bin
export MANPATH=$MANPATH:/opt/local/man/

cd ~

function dumperror()
{
  /Applications/MacPorts/CocoaDialog.app/Contents/MacOS/CocoaDialog \
     ok-msgbox \
     --text "$1"\
     --no-cancel\
     --icon hazard\
     --float\
     --timeout 1
}

urxvt=/opt/local/bin/urxvt

cmd=$(basename "$0")

{

case "$cmd" in
  s-sad)
    LANG=en_CA.UTF-8
    exec $urxvt -bg '#330000' -n 'sad' -e ssh -p 22022 afbd@sad.somewhere.com.
    ;;
  s-popo)
    LANG=en_CA.UTF-8
    exec $urxvt -n 'popo' -e ssh -p 11022 afbd@popo.somewhere.com.
    ;;
  urxvt-window)
    LANG=en_CA.UTF-8
    exec $urxvt -n 'bongo'
    ;;
  gnuplot)
    exec $urxvt -n 'GNUPlot' -e gnuplot
    ;;
  gucharmap)
    exec /opt/local/bin/gucharmap*
    ;;
  *)
    dumperror "Unknown command: $cmd $*"
    ;;
esac

} >/dev/null 2>&1 </dev/null &
