#!/bin/sh


# This gets run after ROX-Session is loaded and running as your session
# manager. ROX-Session will first try to load <Choices>/ROX-Session/Login,
# and only uses this if that is missing.
#
# This script should run any programs you want loaded when you log in and
# then exit. If you want to customise it, first copy it to
# ~/Choices/ROX-Session/Login and then edit that.
#
# See also the ROX-Session/RunROX script.
#
# $1 is the ROX-Session application directory.

if [ ! -n "$CHOICESPATH" ]; then
	CHOICESPATH=${HOME}/Choices:/usr/pkg/share/Choices:/usr/share/Choices
fi
IFS=":"

# If we're using Zero Install, start Zero Progress now so the user gets
# some feedback if nothing happens for a bit (because we're downloading)
if [ -d /uri/0install/zero-install.sourceforge.net ]; then
	0run "zero-install.sourceforge.net/apps/ZeroProgress 2004-03-26" &
fi

# Run any other stuff the user wants by searching all the
# Choices/ROX-Session/AutoStart directories...

for DIR in $CHOICESPATH; do
  if [ -n "$DIR" ]; then
    AS="$DIR/ROX-Session/AutoStart"
    for PROG in $AS/*; do
      if [ -d "$PROG" ]; then
    	  $PROG/AppRun &
      elif [ -x "$PROG" ]; then
	$PROG &
      fi
    done
  fi
done
