## cLIeNUX MCA startx
## this is xf86config and startx, plus
      
#       20000323   Rick Hohensee, primary author   humbubba@smart.net
#	commissioned by Charles Lasitter, North Carolina Direct Marketing

# Initial version will be cLIeNUX and MCA specific.

KEYBOARD=/.et/X/MCA/Keyboard				
## pointer is in the above also



## MAIN MAIN MAIN main()   invocation flow starts here
if test -f /.tm/Xconfigncdm
then
		## existing temp config found.
	clear
	echo "

There is an existing temp config. Hit y<enter> if you want to start 
X with it.

"
	read YN

	if test $YN = "y"
	then


	## SERVER is the second token in the config file
	read COMMENT SERVER JUNK  <  /.tm/Xconfigncdm
	
	echo -e "starting $SERVER"
	/.us/X/command/$SERVER -xf86config /.tm/Xconfigncdm

	fi
fi


clear 
fmt <<HERE 

NCDM cLIeNUX startx

No existing cLIeNUX X config found in /temp/Xconfigncdm, or you've decided
to reconfigure. If you haven't run cLIeNUX startx (this script) before
that's normal. If you have then you may have a backup of a previous
configuration in /suite/X/configure/backup. If you want to use that, copy
it to /temp/Xconfigncdm and restart this script. Otherwise, hit <enter>
and we'll create one.

HERE

read JUNK
clear


fmt <<HERE

We will now try to make you an MCA X config file. The more info you know
about your video setup, the better we'll do.




hit enter when ready


HERE
read JUNK
clear

echo "
What slot is your video adapter card in? (that this X session is for) 
Enter one of the following (numeral or p and <enter>)...
	1	
	2
	3
	4	
	5 
	6
	7
	p	planar


"
read SLOT
clear

cat /.pro/mca/slot$SLOT

echo "




Look OK?  That shouldn't say file not found, at least, and it
	shouldn't clearly be a non-video adapter."

read JUNK

clear
echo "
Enter your monitor type...
	
	9515
	9517
	9518
	8512
 	8513
 	8514
 	8515

"
read MONITOR
if test -e /.et/X/MCA/Monitor/$MONITOR
then 
	echo $MONITOR "data file found"
else
echo "
That string you gave as a monitor type isn't in the cLIeNUX startX
data files. I'll assume some things, but this greatly reduces the
chance of X working.
"



fi

enter JUNK

clear
echo "


Pick your video adapter, input the string in the ENTRY column ...

    ENTRY
    xga		- Adapter  XGA (8595, 9595)
    xga2	- Adapter XGA2 (8595, 9595)
    svga	- Adapter SVGA (9595, 9585 Server)
    8514	- Adapter 8514 ( AVE, various)
    atigup	- ATi Graphics Ultra Pro



"

read ADAPTER


########  build the config file

## set SERVER from the adapter dir
.  /.et/X/MCA/$ADAPTER/Server

####### first line of the config file
echo "## " $SERVER > /.tm/Xconfigncdm  

echo >> /.tm/Xconfigncdm
echo >> /.tm/Xconfigncdm

cat /.et/X/MCA/Files  >>  /.tm/Xconfigncdm

cat /.et/X/MCA/$ADAPTER/ServerFlags >>  /.tm/Xconfigncdm

echo >> /.tm/Xconfigncdm


cat $KEYBOARD >> /.tm/Xconfigncdm

echo >> /.tm/Xconfigncdm

cat /.et/X/MCA/Monitor/$MONITOR >> /.tm/Xconfigncdm

cat /.et/X/MCA/$ADAPTER/$MONITOR >> /.tm/Xconfigncdm

echo EndSection >> /.tm/Xconfigncdm



