#!/bin/sh
#
# Styx's .xinitrc
#
####################################

exec 2>$HOME/xinit.error

XSETROOT=/usr/bin/X11/xsetroot

if [ ! -r /usr/GREAT/bin/greatenv ]
then
	echo "Can't find /usr/GREAT/bin/greatenv"
	exit 1
fi
. /usr/GREAT/bin/greatenv

GSOUND=$GREAT_BIN_DIR/gsound
GWELCOME=$GREAT_BIN_DIR/gwelcome


GPANEL=$GREAT_BIN_DIR/gpanel


if [ ! -x "$XSETROOT" ]
then
	echo "Can't execute $XSETROOT"
else
	$XSETROOT -solid black
fi

if [ ! -x "$GWELCOME" ]
then
	echo "Can't execute $GWELCOME"
else
	if [ ! -x "$GSOUND" ]
	then
		echo "Can't execute $GSOUND"
		$GWELCOME
	else
		$GWELCOME -exec "$GSOUND $GREAT_SOUND_DIR/20th_cent.au"
	fi
fi

$WINDOWMANAGER &

# if you'd want to set this background uncomment the next line
$XSETROOT -bitmap /usr/GREAT/bitmaps/bitmaps/Flock.bm  -bg cornflowerblue

# if you'd want to set this Resources uncomment the next lines
if [ -r $HOME/.great/Greatdefaults ]
then
	xrdb -merge $HOME/.great/Greatdefaults
else
	xrdb -merge $GREAT_LIB_DIR/Greatdefaults
fi

if [ -r $HOME/.Xdefaults ]
then
	xrdb -merge $HOME/.Xdefaults
else
	xrdb -merge $GREAT_LIB_DIR/Xdefaults
fi

# You may at this point start your personal applications.
# e.g xscreensaver

xset b off&
xset m 300/100 3

# Don't put this command in the background
$GPANEL
