#! /bin/sh
# @(#)openwin-init 23.11 94/06/09
# .openwin-init - OpenWindows initialization script.
# WARNING: This file is automatically generated.
#          Any changes you make here will be lost!
#
# Note: toolwait is a utility to control client startup.
#       For more information, see the toolwait(1) man page.

# If current locale require to startup something first (such as im-server)
# let's start now.
if [ -x $OPENWINHOME/bin/locale_env ]; then
	LOCALE=`$OPENWINHOME/bin/locale_env -get_basiclocale`
	if [ -x $OPENWINHOME/lib/locale/$LOCALE/openwin-init ]; then
		exec $OPENWINHOME/lib/locale/$LOCALE/openwin-init
	fi
	if [ -x $OPENWINHOME/lib/locale/$LOCALE/openwin-init-early ]; then
		$OPENWINHOME/lib/locale/$LOCALE/openwin-init-early
	fi
	unset LOCALE
fi

toolwait $OPENWINHOME/bin/cmdtool -Wp 275 0 -Ws 590 77 +Wi -C
toolwait $OPENWINHOME/bin/filemgr -Wp 0 161 -Ws 590 696 +Wi
toolwait $OPENWINHOME/bin/clock -Wp 904 0 -Ws 158 70 +Wi +Wn -24 -digital +date +seconds -alarmtime 0:0 
toolwait $OPENWINHOME/bin/disktool -Wp 0 718 -Wi -t 10 -u -i 60 / /var /usr /opt /tmp
toolwait $OPENWINHOME/bin/audiocontrol -Wp 120 120 -Ws 410 117 -Wi
toolwait $OPENWINHOME/bin/cm -Wp 460 60 -Ws 685 640 -Wi

# The help viewer is placed along the right edge of the screen. Since
# this can vary, figure out the dimensions of the screen we're dealing
# with. Note: The viewer is approximately 550 x 700
eval `xwininfo -root | sed -n -e 's/Height: /SCREENHEIGHT=/p' -e 's/Width: /SCREENWIDTH=/p'`
if [ "$SCREENWIDTH" ]; then
	XLOC=`expr $SCREENWIDTH - 550`
	if [ $XLOC -lt 0 ]; then
		XLOC=0
	fi
else
	XLOC=0
fi

if [ "$SCREENHEIGHT" ]; then
	YLOC=`expr $SCREENHEIGHT - 700`
	YLOC=`expr $YLOC / 2`
	if [ $YLOC -lt 0 ]; then
		YLOC=0
	fi
else
	YLOC=0
fi

# To remove the online intro from the list of applications initially running,
#       delete or comment out the next line.
toolwait $OPENWINHOME/bin/helpviewer -Wp $XLOC $YLOC handbooks/desktop.intro.handbook
