#!/bin/sh

# this will launch afterstep and make sure that
# configurations are set up correctly

add()
{
   if [ ! -r /mit/$1/ ]; then
     attach -h -n -q -a -r $1
   fi
   PATH=${PATH}:/mit/$1/arch/$ATHENA_SYS/bin; export PATH
   MANPATH=${MANPATH}:/mit/$1/man
}

add graphics
add gnu
add newtex
add sipb
add infoagents
add outland
add windowmanagers
add desk
add games

PATH=${PATH}:/mit/windowmanagers/lib/afterstep; export PATH

echo "You are using a VERY BETA WINDOWMANAGER : AfterStep"
echo "Please be aware there may be problems"
echo "If it's having errors, delete your config files:"
echo "     rm -rf ~/GNUstep"
echo ""

zwrite -d -q -s "afterstep zephyr" -n $USER \
       -m "You are using a BETA windowmanager: AfterStep .
You may lose. If you are losing, please try deleting your config files 
by typing: 
     rm -rf ~/GNUstep"

GLOBALDIR="/mit/windowmanagers/share/afterstep"

if [ ! -d $GLOBALDIR ]; then
      echo "Could not find global configurations files"
      echo "Make sure you ran 'attach windowmanagers'"
      exit 1
fi
exec astep.real "$@"
