#!/bin/sh
# $XFree86: mit/clients/xinit/xinitrc.cpp,v 1.3 1993/04/11 13:50:35 dawes Exp $
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources

if [ x"$XWINHOME" != x ]; then
    XINIT_DIR=$XWINHOME/lib/X11/xinit
else
    XINIT_DIR=/usr/X11R6/lib/X11/xinit
fi

# export OPENWINHOME and HELPPATH

export OPENWINHOME=/usr/openwin
export HELPPATH=$OPENWINHOME/help

sysresources=$XINIT_DIR/.Xresources
userdefaults=$HOME/.Xdefaults

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi

if [ -f $userdefaults ]; then
	xrdb -merge $userdefaults
fi

# start some nice programs

xsetroot -solid SteelBlue &

# load lst logo onto background

if [ -f /usr/X11R6/bin/xsetbg ]; then
	/usr/X11R6/bin/xsetbg -colors 32 -fillscreen /usr/share/data/gif/lst.gif &
else
	if [ -f /usr/X11R6/bin/xv ]; then
		/usr/X11R6/bin/xv -rmode 1 -max -ncols 128 -quit /usr/share/data/gif/lst.gif &
	fi
fi

# launch xconsole, xclock and place an icon for xman

xconsole -C -fn '*5x7*' -notify -geometry 400x40+160+0 &
xclock -geometry 60x58+570+0 &
xman -iconic &

# launch perfmeter if rpc.rstatd is running

if [ -f /usr/X11R6/bin/perf -a -f /usr/sbin/rpc.rstatd ]; then
	ps aux | grep rpc.rstatd | grep -v grep > /dev/null
	if [ $? -eq 1 ]; then
		/usr/sbin/rpc.rstatd &
	fi
	perf -geometry 225x75+405+67 -cpu -page -load -swap -columns 2 &
fi

# launch one xterm with small fonts

/usr/X11R6/bin/xterm -sb -sl 500 -j -ls -fn 6x10 -bg LightSteelBlue -geometry 80x24+82+205 &

# start the window-manager and redirect output to xconsole

exec fvwm > /dev/console 2>&1
