[comp.sources.x] v05i049: startx - X Windows session initiator, Part01/01

kent@ssbell.uu.net (Kent Landfield) (12/19/89)

Submitted-by: George Kraft IV <gk4@staff.cc.purdue.edu>
Posting-number: Volume 5, Issue 49
Archive-name: startx/part01

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# If this archive is complete, you will see the following message at the end:
#		"End of archive 1 (of 1)."
# Contents:  startx startx/Imakefile startx/Imakefile.pucc startx/lib
#   startx/lib/twmrc startx/lib/xdefaults startx/lib/xsession
#   startx/startx.1l startx/startx.NewsLetter startx/startx.cpp
#   startx/startx.newsletter
# Wrapped by kent@ssbell.uu.net on Mon Dec 18 14:45:38 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'startx' ; then
    echo shar: Creating directory \"'startx'\"
    mkdir 'startx'
fi
if test -f 'startx/Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/Imakefile'\"
else
echo shar: Extracting \"'startx/Imakefile'\" \(163 characters\)
sed "s/^X//" >'startx/Imakefile' <<'END_OF_FILE'
X
XPROGRAMS = startx
X
XMakeScriptFromCpp(startx, -DBINDIR=$(BINDIR) -DUNSUPBINDIR=$(UNSUPBINDIR))
X
XInstallProgram(startx,$(BINDIR))
X
Xclean::
X	/bin/rm -rf $(PROGRAMS)
END_OF_FILE
if test 163 -ne `wc -c <'startx/Imakefile'`; then
    echo shar: \"'startx/Imakefile'\" unpacked with wrong size!
fi
# end of 'startx/Imakefile'
fi
if test -f 'startx/Imakefile.pucc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/Imakefile.pucc'\"
else
echo shar: Extracting \"'startx/Imakefile.pucc'\" \(438 characters\)
sed "s/^X//" >'startx/Imakefile.pucc' <<'END_OF_FILE'
X
XPROGRAMS = startx
X
XMakeScriptFromCpp(startx, -DBINDIR=$(BINDIR) -DUNSUPBINDIR=$(UNSUPBINDIR))
X
XInstallProgram(startx,$(BINDIR))
X
Xinstall::
X	if [ ! -d $(LIBDIR)/startx ]; then \
X		mkdir $(LIBDIR)/startx ; \
X		chmod 755 $(LIBDIR)/startx ; \
X	else \
X		exit 0; \
X	fi
X
XInstallNonExec(lib/xdefaults, $(LIBDIR)/startx)
XInstallNonExec(lib/twmrc, $(LIBDIR)/startx)
XInstallNonExec(lib/xsession, $(LIBDIR)/startx)
X
Xclean::
X	/bin/rm -rf $(PROGRAMS)
END_OF_FILE
if test 438 -ne `wc -c <'startx/Imakefile.pucc'`; then
    echo shar: \"'startx/Imakefile.pucc'\" unpacked with wrong size!
fi
# end of 'startx/Imakefile.pucc'
fi
if test ! -d 'startx/lib' ; then
    echo shar: Creating directory \"'startx/lib'\"
    mkdir 'startx/lib'
fi
if test -f 'startx/lib/twmrc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/lib/twmrc'\"
else
echo shar: Extracting \"'startx/lib/twmrc'\" \(4458 characters\)
sed "s/^X//" >'startx/lib/twmrc' <<'END_OF_FILE'
X#	Purdue University Computing Center
X#	George Kraft IV, Unix Systems Staff
X#
X#	.twmrc file to be read by twm(1L) started in file .xsession
X#
X
XBorderWidth		1
XZoom			2
XForceIcons
XShowIconManager
XIconifyByUnmapping
XIconDirectory		"/share/icons"
XIconManagerGeometry	"175x80-1+80"
XDefaultFunction		f.beep
XIconFont		"9x15"
XTitleFont		"9x15"
XMenuFont		"9x15"
X
XButton1 =      : root    : f.menu "Hosts"
XButton1 =      : title	 : f.raise
XButton1 =      : frame   : f.raise
XButton1 =      : icon	 : f.iconify
X
XButton2 =      : root    : f.menu "TWM"
XButton2 =      : title   : f.move
XButton2 =      : frame   : f.move
XButton2 =      : icon	 : f.move
X
XButton3 =      : root	 : f.menu "Tools"
XButton3 =      : title	 : f.fullzoom
XButton3 =      : frame	 : f.lower
X
XIconManagerDontShow {
X	"xlogin"
X	"xbiff"
X	"xload"
X	"dclock"
X	"xclock"
X	"xpostit"
X	"dayEditor"
X	"PostItNote"
X	"TWM Icon Manager"
X}
X
XAutoRaise {
X	"TWM Icon Manager"
X	"xpostit"
X	"xcalc"
X	"xfig"
X	"dclock"
X	"xclock"
X	"xload"
X	"xterm"
X	"xcalendar"
X	"dayEditor"
X}
X
XDontIconifyByUnmapping {
X	"xbiff"
X	"dclock"
X	"xclock"
X	"xpostit"
X	"PostItNote"
X	"TWM Icon Manager"
X}
X
XNoTitle {
X	"POSTSCRIPT"
X	"xfd"
X	"xpostit"
X	"xlogo"
X	"xbiff"
X	"dclock"
X	"xclock"
X	"PostItNote"
X	"postitnote"
X	"xpostitnote"
X	"TWM Icon Manager"
X}
X
X#
X#	Use the TWM Window Manager instead.
X#
X#	UnknownIcon		"huh.xbm"
X#
X#	IconGeometry {
X#		"xterm"		"20x20+100+100"
X#		"console"	"20x20+100+300"
X#		"xbiff"		"20x20+100+400"
X#	}
X#
X#	Icons {
X#		"xterm"			"xterm.xbm"
X#		"xbiff"			"huh.xbm"
X#		"xps" 			"coke.xbm"
X#		"bitmap" 		"coke.xbm"
X#		"console" 		"console.xbm"
X#		"xfd" 			"xfd_icon"
X#	}
X
XMenu "Hosts" {
X	"Remote Logins by Dept"	f.title
X	"LocalHost" 		!"xterm -T `hostname` &"
X	"PUCC"			f.menu "PUCC"
X	"STAT"			f.menu "STAT"
X	"ECN"			f.menu "ECN"
X	"CS"			f.menu "CS"
X}
X
X
XMenu "PUCC" {
X	"Computing Center"	f.title
X	"boiler   # ETA 10P*"    !"xterm -T Boiler.cc -tn xterms -e rlogin boiler.cc &"
X	"element  # Sun 3/280"	 !"xterm -T Element.cc -e rlogin element.cc &"
X	"expert   # Sequent S81" !"xterm -T Expert.cc -e rlogin expert.cc &"
X	"h        # Vax 11/780"  !"xterm -T H.cc -e rlogin h.cc    &"
X	"j        # Vax 11/780"  !"xterm -T J.cc -e rlogin j.cc    &"
X	"m        # Vax 11/780"	 !"xterm -T M.cc -e rlogin m.cc    &"
X	"mace     # Vax 8800" 	 !"xterm -T Mace.cc -e rlogin mace.cc &"
X	"mentor   # Sequent S81" !"xterm -T Mentor.cc -e rlogin mentor.cc &"
X	"n        # Vax 11/780"	 !"xterm -T N.cc -e rlogin n.cc    &"
X	"sage     # Sequent S81" !"xterm -T Sage.cc -e rlogin sage.cc &"
X	"staff    # Sun 3/280"	 !"xterm -T Staff.cc -e rlogin staff.cc &"
X	"tyro     # Sequent S81" !"xterm -T Tyro.cc -e rlogin tyro.cc &"
X	"vm       # IBM 3090-180E" !"xterm -T PURCCVM -name vmxterm -e tn3270 vm.cc &"
X}
X
XMenu "STAT" {
X	"Statistics"	f.title
X	"l        # Vax 11/780"	 !"xterm -T L.cc -e rlogin l.cc &"
X	"pop.stat # Sun 3/280"	 !"xterm -T Pop.stat -e rlogin pop.stat &"
X}
X
XMenu "ECN" {
X	"Engineering Computing Network"	f.title
X	"ea         # Vax 11/780" !"xterm -T Ea.ecn -e rlogin ea.ecn &"
X	"orchestra  # Sun 3/280" !"xterm -T Orchestra.ecn -e rlogin orchestra.ecn &"
X}
X
X
XMenu "CS" {
X	"Computer Science"	f.title
X	"arthur  # Sequent B21" !"xterm -T Arthur.cs -e rlogin arthur.cs &"
X}
X
Xmenu "Tools" {
X	"Tools"			f.title
X	"dclock"		!"dclock &"
X	"index"			!"xterm -e index &"
X	"xbiff"			!"xbiff &"
X	"xcalendar"		!"xcalendar &"
X	"xfig"			!"xfig -L &"
X	"xcalc"			!"xcalc &"
X	"xclip"			!"xclipboard &"
X	"xpostit"		!"xpostit &"
X	"Print X Window"	!"xwd | xpr -device ps | lpr &"
X	"Dump  X Window"	!"(xwd | xwdtopbm | pbmtoxbm > dump$$.xbm &)"
X}
X
X
Xmenu "TWM" {
X	"Tom's Window Manager"	f.title
X	"Refresh"		f.refresh
X	"Source .twmrc"		f.twmrc
X	"Destroy Window"	f.destroy
X	"(De)Iconify"		f.iconify
X	"Show Icon Mgr"		f.showiconmgr
X	"Full Zoom/UnZoom"	f.fullzoom
X	"Focus on Window"	f.focus
X	"Root Window Focus"	f.unfocus
X	"Move Window"		f.move
X	"Resize Window"		f.resize
X	"Raise Window"		f.raise
X	"Lower Window"		f.lower
X	"Cut File"		f.cutfile
X	"Kill twm"		f.quit
X	"Root Window"		f.menu "RtWindow"
X}
X
X
Xmenu "RtWindow" {
X	"Root Window"	f.title
X	"black"		!"xsetroot -solid black &"
X	"grey"		!"xsetroot -grey &"
X	"PUCC white"	!"xsetroot -bitmap /share/icons/pucc.xbm &"
X	"PUCC black"	!"xsetroot -bitmap /share/icons/pucc.xbm -rv &"
X	"balls3"	!"xsetroot -bitmap /share/icons/balls3.xbm &"
X	"astronaut"	!"xsetroot -bitmap /share/icons/astronaut.xbm &"
X	"fullmoon"	!"xsetroot -bitmap /share/icons/fullmoon.xbm &"
X	"zippy"		!"xsetroot -bitmap /share/icons/zippy.xbm &"
X}
END_OF_FILE
if test 4458 -ne `wc -c <'startx/lib/twmrc'`; then
    echo shar: \"'startx/lib/twmrc'\" unpacked with wrong size!
fi
# end of 'startx/lib/twmrc'
fi
if test -f 'startx/lib/xdefaults' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/lib/xdefaults'\"
else
echo shar: Extracting \"'startx/lib/xdefaults'\" \(635 characters\)
sed "s/^X//" >'startx/lib/xdefaults' <<'END_OF_FILE'
X!	Purdue University Computing Center
X!	George Kraft IV, Unix Systems Staff
X!
X!	.xdefaults file to by read by xrdb(1L) invoked in .xsession
X!
XDClock*Geometry:	175x75-1+0
XDClock*bell:		false
XDClock*scroll:		false
XDClock*date:		%w %M %d, %Y
XXBiff*Geometry:		75x75-176+0
XXBiff*Volume:		100
XXBiff*Interval:		60
XXPostit.Geometry:	75x75-252+0
XXPostit*saveNotes:	true
XXLogin*Iconic:		on
XXTerm*ScrollBar:	on
XXTerm*Geometry:		80x24+250+300
XXTerm*SaveLines:	500
XXTerm*Iconic:		on
XXTerm*Font:		8x13bold
XXTerm*loginShell:	true
XXTerm*UtmpInhibit:	true
XXTerm*VisualBell:	true
XXTerm*pointerShape:	pencil
Xvmxterm*font:		8x13
Xvmxterm*boldFont:	8x13bold
END_OF_FILE
if test 635 -ne `wc -c <'startx/lib/xdefaults'`; then
    echo shar: \"'startx/lib/xdefaults'\" unpacked with wrong size!
fi
# end of 'startx/lib/xdefaults'
fi
if test -f 'startx/lib/xsession' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/lib/xsession'\"
else
echo shar: Extracting \"'startx/lib/xsession'\" \(674 characters\)
sed "s/^X//" >'startx/lib/xsession' <<'END_OF_FILE'
X#!/bin/csh -f
X#
X#	Purdue University Computing Center
X#	George Kraft IV (gk4), Unix Systems Staff
X#
X#	$HOME/.xsession file
X
Xsetenv HOST `hostname | sed -e 's/\.edu$//' -e 's/\.purdue$//' -e 's/\.cc$//'`
X
X(twm &)
X
X#
X#	Load defaults after the window manage is started.
X#
X
Xxrdb -load .xdefaults
X(xsetroot -gray -cursorfont XC_iron_cross &)
X(xset -c r &)
X(dclock &)
X
Xif ("$HOST" == "expert") then
X	(xbiff &)
Xelse
X	(rsh expert -n /usr/local/X11/xbiff -d $DISPLAY &)
Xendif
X
X#
X#  The last line must be in the foreground, and should be an xterm(1L).
X#
X
Xif ("`tty`" == "/dev/console") then
X	xterm  -g 80x24+0+0 +ut -C -T "CONSOLE $HOST"
Xelse
X	xterm  -g 80x24+0+0 +ut -T "$HOST"
Xendif
END_OF_FILE
if test 674 -ne `wc -c <'startx/lib/xsession'`; then
    echo shar: \"'startx/lib/xsession'\" unpacked with wrong size!
fi
# end of 'startx/lib/xsession'
fi
if test -f 'startx/startx.1l' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/startx.1l'\"
else
echo shar: Extracting \"'startx/startx.1l'\" \(9053 characters\)
sed "s/^X//" >'startx/startx.1l' <<'END_OF_FILE'
X.\" 
X.\"  Copyright 1989 Purdue Research Foundation
X.\" 
X.\"  Permission to use, copy, modify, distribute, and sell this software 
X.\"  and its documentation for any purpose is hereby granted without fee, 
X.\"  provided that the above copyright notice appear in all copies and that 
X.\"  both that copyright notice and this permission notice appear in 
X.\"  supporting documentation, and that the name of Purdue not be used in 
X.\"  advertising or publicity pertaining to distribution of the software 
X.\"  without specific, written prior permission.  Purdue makes no 
X.\"  representations about the suitability of this software for any purpose.  
X.\"  It is provided "as is" without express or implied warranty.
X.\" 
X.\"  PURDUE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
X.\"  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 
X.\"  PURDUE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 
X.\"  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
X.\"  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 
X.\"  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
X.\"  SOFTWARE.
X.\" 
X.\"  Author:  George Kraft IV (gk4@staff.cc.purdue.edu)
X.\"           Purdue University Computing Center
X.\"           Mathematical Sciences Building
X.\"           West Lafayette, IN 47907
X.\" 
X.TH STARTX 1L PUCC
X.SH NAME
Xstartx \- robustly start an X windows session
X.SH SYNOPSIS
X.B startx 
X[
X.B -d | -w
X] [
X.B -x
X.I startup
X| [
X.B -r
X.I resources
X] [
X.B -m
X.I window_manager
X]]
X.SH DESCRIPTION
XThere are many ways to initiate an X windows session, and \fIstartx\fR
Xis designed to ease the burden on the user.  First, \fIstartx\fR sets the user's
X\fBDISPLAY\fR environment variable to identify the X server to the X clients.
XNext a distinction is made between the user's use of a workstation or an X
Xdisplay station, then the appropriate invocation is made to get the X windows
Xsession started.  This invocation entails starting the X server & X clients for
Xa workstation, or starting the X clients for an X display station.
X.LP
X\fIStartx\fR redirects X server and X client error messages to the file 
Xspecified by the user's \fBXERRORS\fR environment variable.  This is very
Xuseful for debugging, and gives X a clean startup & shutdown appearance on 
Xworkstations.
X.LP
XYou should note that you can use one or both of the \fB\-m\fR and \fB\-r\fR
Xoptions, or the \fB\-x\fR option, but you cannot use the \fB\-x\fR option
Xin conjunction with the \fB\-m\fR and \fB\-r\fR options.  In the \fIstartup\fR
Xscript, it is the responsibility of the user to start a window manager, load 
XX resources, & spawn X clients.
X.LP
XIf no \fIstartup\fR script file name is given at the command line with
Xthe \fB\-x\fR option,
Xthen \fIstartx\fR looks for a file named in the user's \fBXINITRC\fR 
Xenvironment variable.  If \fBXINITRC\fR is not set, then \fIstartx\fR
Xlooks in the user's home directory for a file 
Xcalled \fI.Xinit, .xinit, .Xinitrc, .xinitrc,\fR 
Xor \fI.xsession,\fR respectively, to begin the X client programs.
X.LP
XIf no \fIstartup\fR file is found, \fIstartx\fR runs the
X\fIwindow_manager\fR indicated at the command line with the \fB\-m\fR option, 
Xor invokes the window manager \fItwm\fR(1L), \fIawm\fR(1L), or \fIuwm\fR(1L) 
Xafter finding the associated configuration files \fI .twmrc, .awmrc,\fR 
Xor \fI .uwmrc\fR respectively.  If a window manager configuration 
Xfile is not found in the user's home directory, \fIstartx\fR initiates 
Xan \fIxterm\fR(1L) client and the \fItwm\fR(1L) window manager.
X.LP
XWhen no \fIstartup\fR file is found, \fIstartx\fR also instructs the 
Xload of the \fIresources\fR file given at the command line with the \fB\-r\fR
Xoption, or a file from the user's home directory 
Xcalled \fI.Xdefaults, .xdefaults, .Xresources,\fR 
Xor \fI.xresources,\fR respectively.  If an X \fIresources\fR files if not 
Xfound, then the X windows session will not be personalized.
X.SH OPTIONS
X.IP "\fB-d\fR" 20
XStart X clients for an X display station.  
X.IP "\fB-w\fR" 20
XStart the X server and X clients for an X window session on a 
Xworkstation.  
X.IP "\fB-x\fR \fIstartup\fR" 20
XStart an X windows session using the \fIstartup\fR script.
X.IP "\fB-r\fR \fIresources\fR" 20
XLoad the \fIresources\fR file when no \fIstartup\fR script is found. 
X.IP "\fB-m\fR \fIwindow_manager\fR" 20
XStart the \fIwindow_manager\fR when no \fIstartup\fR scripts is found. 
X.SH EXAMPLES
X.IP "startx" 20
XStart an X windows session on a workstation, or for an X display station.
X.IP "startx -w" 20
XForce start an X windows session on a workstation.
X.IP "startx; kill -9 $$" 20
XUseful for starting an X Windows session for an X display station, and
Xlogging off the user's \fItelnet\fR(1C) session.
X.IP "startx -x \fI.xinitrc\fR" 20
XStart an X windows session using the \fI.xinitrc\fR script.
X.IP "startx -w \fItwm\fR" 20
XStart an X windows session using the \fItwm\fR window manager; however, if
Xa \fIstartup\fR script file is found, then the \fB\-w\fR option is ignored.
X.SH "EXAMPLE STARTUP SCRIPT"
X.LP
XIn the \fIstartup\fR script, it is the responsibility of the user to start
Xa window manager, load X resources, & spawn X clients.  Below is an 
Xexample \fI.xsession\fR script.
X.sp
X.RS
X.nf
X#!/bin/csh
X(twm &)
Xxrdb -load .xdefaults
X(xclock -g 75x75+0+0 &)
X(xbiff  -g 75x75+101-0 &)
Xif ("/dev/console" == "`tty`") then
X        xterm -g 80x24+0+0 +ut -C -T `hostname`
Xelse
X        xterm -g 80x24+0+0 +ut -T `hostname`
Xendif
X.fi
X.RE
X.LP
XFor a workstation, the last line in the \fIstartup\fR script 
Xshould be a foreground \fIxterm\fR(1L) with the \fB-C\fR option for console 
Xmessages.  
X.LP
XFor an X display station, the last line in the \fIstartup\fR script 
Xshould be a foreground \fIxterm\fR(1L) without the \fB-C\fR option.  
XAlso, some X display stations will not terminate the \fItelnet\fR(1C)
Xsession upon closing; therefore, one should \fIexec\fR(1) \fIstartx\fR
Xto over write the current \fItelnet\fR(1C) session and begin the X windows 
Xsession.
X.SH ENVIRONMENT VARIABLES
X.IP "\fBDISPLAY\fR" 20
XThe name of the X server to which X clients should connect to.
X.IP "\fBXERRORS\fR" 20
XWhere \fIstartx\fR is to redirect error messages.  By default, \fIstartx\fR 
Xredirects errors to the file \fI.xerrors\fR in user's home directory.
X.IP "\fBXINITRC\fR" 20
XAn \fIstartup\fR file containing shell commands to start a window manager,
Xload X resources, & spawn X clients.
X.SH TERMINOLOGY
X.IP "workstation" 20
XA multi-purpose host computer, normally with a bitmap display and a mouse.
XThe X server & X clients run on the workstation.
X.IP "window manager" 20
XA program which allows you to move, resize, and circulate windows on your 
Xdisplay.
X.IP "X display station" 20
XIs a machine dedicated as an X server.  Only the X server runs on the
XX display station.
X.IP "X client" 20
XA program that performs a task such as terminal emulation, clock,
Xor window management.
X.IP "X resources" 20
XAre the user preferences of your environment such as screen size &
Xplacement, border & background color, and window title & scroll bars.
Xetc.
X.IP "X server" 20
XIs a combination of the graphics display, keyboard, mouse, hardware, and X 
Xserver software which accepts input from these devices and provides display
Xservices for X clients.
X.SH BUGS
X.LP
XFor a workstation if a \fIstartup\fR exists & no \fIresources\fR are loaded
Xby the user, then \fIxinit\fR(1L) within \fIstartx\fR will try to load 
Xan \fI.Xdefaults\fR file.
X.LP
XThe use of a workstation is assumed when the X session is being initiated
Xfrom \fI/dev/console\fR.  If this is not the case, then user must use
Xthe \fB-d\fR, or \fB-w\fR option.  See \fItty\fR(1) for more details.
X.LP
XThe multitude of names for the same files is confusing; however, \fIstartx\fR
Xincludes these historical names for robustness.
X.SH AUTHOR
XCopyright 1989 Purdue Research Foundation
X.br
XGeorge Kraft IV, Purdue University Computing Center
X.br
Xgk4@staff.cc.purdue.edu
X.SH SEE ALSO
Xawm(1U), tty(1), twm(1L), uwm(1L), X(1L), xdm(1U), xinit(1L), xrdb(1L), xterm(1L)
X.br
XO'Reilly & Associates, \fBX Window System User's Guide,\fR 1988.
X.SH FILES
X.IP $HOME/.xerrors 20
XSee \fBXERRORS\fR above.
X.IP $HOME/.Xinit 20
XSee \fBXINITRC\fR above.
X.IP $HOME/.xinit 20
XSee \fBXINITRC\fR above.
X.IP $HOME/.Xinitrc 20
XSee \fBXINITRC\fR above.
X.IP $HOME/.xinitrc 20
XSee \fBXINITRC\fR above.
X.IP $HOME/.xsession 20
XSee \fBXINITRC\fR above.
X.IP $HOME/.Xdefaults 20
XX \fIresources\fR file loaded to set user preferences for X clients.
X.IP $HOME/.xdefaults 20
XX \fIresources\fR file loaded to set user preferences for X clients.
X.IP $HOME/.Xresources 20
XX \fIresources\fR file loaded to set user preferences for X clients.
X.IP $HOME/.xresources 20
XX \fIresources\fR file loaded to set user preferences for X clients.
X.IP $HOME/.twmrc 20
X.IR twm (1L)
Xconfiguration file.
X.IP $HOME/.awmrc 20
X.IR awm (1L)
Xconfiguration file.
X.IP $HOME/.uwmrc 20
X.IR uwm (1L)
Xconfiguration file.
X.IP /dev/console 20
XThe \fItty\fR(4) of a workstation's initial \fIlogin\fR(1) shell.
END_OF_FILE
if test 9053 -ne `wc -c <'startx/startx.1l'`; then
    echo shar: \"'startx/startx.1l'\" unpacked with wrong size!
fi
# end of 'startx/startx.1l'
fi
if test -f 'startx/startx.NewsLetter' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/startx.NewsLetter'\"
else
echo shar: Extracting \"'startx/startx.NewsLetter'\" \(8332 characters\)
sed "s/^X//" >'startx/startx.NewsLetter' <<'END_OF_FILE'
X
X-----------------------------------------------------------------------
X
X               The Syntax of the UNIX Startx Utility
X
XThe syntax of the UNIX startx command and its options is
X
Xstartx [-d | -w] [-x startup | [-r resources | -m window_manager] ]
X
Xwhich represents two sets of options.  The first set consists of
Xthe mutually exclusive options -d or -w which helps startx
Xdistinguish which type of terminal you are using.  These options
Xwill only be used in rare circumstances and you should consult the
Xmanual page for more details.
X
XThe second set of options consists of a choice between setting up
Xyour X Window System environment with one shell script file using
Xthe -x option, or by specifying your X resources and window manager
Xseparately using the -r and -m options.  You should note that you
Xcan use one or both of the -m and -r options, or the -x option, but
Xyou cannot use the -x option in conjunction with the -m and -r
Xoptions.
X
X-----------------------------------------------------------------------
X
X
XUNIX Startx Utility Makes the X Window System Easy
X
XThe X Window System is a network-based graphics window
Xsystem which was developed at the Massachusetts Institute of
XTechnology in 1984.  PUCC hosts run the most recent version
Xof the X Window System, X11.  The X Window System is
Xavailable on all of our Sequent Symmetries, Sun
Xworkstations, and the VAX 8800.
X
XThere are many ways to initiate an X Window System session
Xwhich require you to go through several steps to create a
Xworking environment.  The UNIX startx utility is designed to
Xease your burden by allowing you to start your window
Xmanager, load your X resources, and initiate other X clients
Xwith one command.
X
XWindow Managers, X Resources,
XX Servers and X Clients
X
XIn order for you to understand how startx works, it is
Ximportant that you know the meanings of the terms window
Xmanager, X resource, X server, and X client.
X
Xo A window manager is a program which allows you to move and
X  resize windows on your display.  These windows act like
X  individual terminal screens which you can manipulate,
X  layer, and move around.
X
Xo An X resource is a personalized attribute of your
X  environment such as color, cursor symbol, etc. You can
X  tailor your X Window session environment to make the
X  cursor symbol change when moved to other windows, make a
X  scroll bar, or make the windows change colors for easier
X  identification.  These are just a few examples of X
X  resources.
X
Xo Your X server communicates and translates all input so
X  that your particular display can understand all the
X  information it receives.  The X server is a combination of
X  the graphics display, keyboard, mouse, hardware, and X
X  server software which accepts input from these devices and
X  provides display services for clients.  The X server
X  software must run locally in order to communicate with
X  these devices.
X
Xo An X client is a program that performs a task such as
X  terminal emulation or window management to shape your X
X  Window System environment.
X
XStartx sets your DISPLAY environment variable to identify
Xthe X server to the X clients.  This enables your X clients
Xto communicate with it and set up your X Window System
Xsession.
X
XYou can find out more about your environment variables by
Xchecking the manual pages of the UNIX shell you are using
X(sh(1), ksh(1L), csh(1), or tcsh(1L)) or by asking a PUCC
Xgeneral consultant for assistance.
X
XCreating a Startup Shell Script File
X
XYou can define and load your X resources and your window
Xmanager easily using a startup shell script file.  Startx
Xreads this file if you use the -x option on the command
Xline, if you name the file in your XINITRC environment
Xvariable, or if you name the file .Xinit, .xinit, .Xinitrc,
X.xinitrc, or .xsession in your home directory.  In this
Xfile, it is your responsibility to start a window manager,
Xload X resources, and create X clients.  A working example
Xof a startup shell script file follows:
X
X   #!/bin/csh
X   (twm &)
X   xrdb -load .xdefaults
X   (xclock -g 75x75+0+0 &)
X   (xbiff  -g 75x75+101-0 &)
X   if ("/dev/console" == "`tty`") then
X     xterm -g 80x24+0+0 +ut -C -T `hostname`
X   else
X     xterm -g 80x24+0+0 +ut -T `hostname`
X   endif
X
XFor a workstation, it is important that the last line in
Xyour startup shell script file be an invocation of xterm(1L)
Xrunning in the foreground with the -C option for console
Xmessages.
X
XFor an X display station, the last line in the startup
Xscript should be an invocation of xterm(1L) running in the
Xforeground without the -C option.  Be aware that some X
Xdisplay stations will not terminate the telnet(1C) session
Xon closing, so you should remember to manually logoff the
Xsession after leaving the X Window session.
X
XNow that you know what a startup file looks like, you can
Xtell startx to read this file in one of three ways.
X
Xo You can use the -x option and a startup shell script file
X  to invoke startx by entering
X  
X     startx -x startup
X
X  In this example, startx will run the given shell script file,
X  startup.  Startx looks for a file specified with the -x
X  option before looking for any other initialization files.
X
Xo You can set your XINITRC environment variable to the
X  startup shell script file name you want to use.  If you
X  don't give any startup shell script file name at the
X  command line using the -x option, then startx looks for a
X  startup shell script file named by your XINITRC
X  environment variable.
X
X  Again, you can find out more about setting your
X  environment variables by checking the manual pages of the
X  UNIX shell you are using (sh(1), ksh(IL), csh(1), or
X  tcsh(1L)) or by asking a PUCC general consultant for
X  assistance.
X
Xo You can name your startup shell script file .Xinit,
X  .xinit, .Xinitrc, .xinitrc, or .xsession to begin the X
X  client programs.  If you haven't used the -x option or set
X  XINITRC, then startx looks in your home directory for any
X  file with the names in the order given above.  It looks
X  for these file names specifically because they are the
X  most common names for initialization files; however, we
X  recommend using the name .xsession for your startup shell
X  script file.
X
XDefining X Attributes Without a Startup File
X
XIf startx doesn't find a startup shell script file, it loads
Xan X resources file which you supply at the command line
Xusing the -r option. This is done by entering
X
X   startx -r resources
X   
Xwhere resources is the name of the X resources configuration
Xfile you wish to use.  (See the xrdb(1L) and x(1L) manual pages
Xfor more information on X resources.)
X
XIf you don't use the -r option, startx looks for a file in
Xyour home directory called .Xdefaults, .xdefaults,
X.Xresources, or .xresources, respectively.  If it doesn't
Xfind any of these X resource files, then your X Window
XSystem session will not have personalized attributes.
X
XAgain, if you don't specify a startup shell script file
Xusing the -x option, startx looks for a window manager
Xindicated at the command line using the -m option.  This is
Xdone by entering
X
X   startx -m window_manager
X   
XIf you don't use the -m option, then startx invokes one of
Xthe window managers twm(1L), awm(1L), or uwm(1L) if it finds
Xone of the associated configuration files in your home
Xdirectory named .twmrc, .awmrc, or .uwmrc, respectively.  If
Xstartx can't find one of the window manager configuration
Xfiles in your home directory, it starts an xterm(1L) client
Xand the twm(1L) window manager by default.
X
XTracing Errors
X
XNot only does startx start all your X clients for you, it
Xalso redirects error messages into a file for any errors
Xencountered while trying to start your X Window System
Xsession.
X
XIf you set your environment variable XERRORS to the name of
Xan errors file, startx will redirect error messages to that
Xfile.  If you don't set your XERRORS environment variable,
Xstartx creates an errors file called .xerrors in your home
Xdirectory and redirects any error messages to that file.
X
XAdditional References
X
XFor more information on the X Window System see the X Window
XSystem User's Guide, Volume Three, by O'Reilly & Associates,
XInc.  This manual is available for loan at the PUCC
XReference/Loan Library in MATH B6.  For a general overview
Xof the X Window System consult the November 1989 issue of
Xthe PUCC Newsletter.
X
X               - George Kraft & Michael Melton
END_OF_FILE
if test 8332 -ne `wc -c <'startx/startx.NewsLetter'`; then
    echo shar: \"'startx/startx.NewsLetter'\" unpacked with wrong size!
fi
# end of 'startx/startx.NewsLetter'
fi
if test -f 'startx/startx.cpp' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/startx.cpp'\"
else
echo shar: Extracting \"'startx/startx.cpp'\" \(5821 characters\)
sed "s/^X//" >'startx/startx.cpp' <<'END_OF_FILE'
X/**/#!/bin/sh
X/**/#
X/**/# 
X/**/#  Copyright 1989 Purdue Research Foundation
X/**/# 
X/**/#  Permission to use, copy, modify, distribute, and sell this software 
X/**/#  and its documentation for any purpose is hereby granted without fee, 
X/**/#  provided that the above copyright notice appear in all copies and that 
X/**/#  both that copyright notice and this permission notice appear in 
X/**/#  supporting documentation, and that the name of Purdue not be used in 
X/**/#  advertising or publicity pertaining to distribution of the software 
X/**/#  without specific, written prior permission.  Purdue makes no 
X/**/#  representations about the suitability of this software for any purpose.  
X/**/#  It is provided "as is" without express or implied warranty.
X/**/# 
X/**/#  PURDUE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
X/**/#  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 
X/**/#  PURDUE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 
X/**/#  ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
X/**/#  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 
X/**/#  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
X/**/#  SOFTWARE.
X/**/# 
X/**/#  Author:  George Kraft IV (gk4@staff.cc.purdue.edu)
X/**/#           Purdue University Computing Center
X/**/#           Mathematical Sciences Building
X/**/#           West Lafayette, IN 47907
X/**/# 
X/**/#
X/**/#	startx(1L) - Robustly start X on a workstation/displaystation,
X/**/#		     employing the user configuration files provided.
X/**/#			
X/**/#			
X/**/#	WORKSTATIONS:		startx
X/**/#			
X/**/#	DISPLAYSTATIONS: 	exec; kill -9 $$
X
XPATH=$PATH:BINDIR:UNSUPBINDIR
X
X/**/#	
X/**/#	Current working directory is home.
X/**/#
X
Xcd
X
X/**/#
X/**/#  Parse the arguments.
X/**/#
X
Xusage="USAGE: $0 [-d | -w] [-x <startup> | [-r <resources>] [-m <wmgr>]]"
X
X/**/# How to chop an argument off.
Xcut='P=$1
Xshift
Xset __ -`expr "$P" : '\''-.\(.*\)'\''` "$@"; shift'
X
X/**/# "dwm:r:x:"
Xwhile [ $# -gt 0 ]; do
X	case "$1" in
X	-d)
X		if [ "true" = "${WFLAG-}" ]; then 
X			echo "$usage" 2>&1
X			exit
X		fi
X		DFLAG=true
X		WFLAG=false
X		shift
X		;;
X	-d*)
X		if [ "true" = "${WFLAG-}" ]; then 
X			echo "$usage" 2>&1
X			exit
X		fi
X		DFLAG=true
X		WFLAG=false
X		eval "$cut"
X		;;
X	-w)
X		if [ "true" = "${DFLAG-}" ]; then 
X			echo "$usage" 2>&1
X			exit
X		fi
X		WFLAG=true
X		DFLAG=false
X		shift
X		;;
X	-w*)
X		if [ "true" = "${DFLAG-}" ]; then 
X			echo "$usage" 2>&1
X			exit
X		fi
X		WFLAG=true
X		DFLAG=false
X		eval "$cut"
X		;;
X	-r)
X		xdefaults=$2
X		shift ; shift
X		;;
X	-r*)
X		xdefaults=`expr "$1" : '-r\(.*\)'`
X		shift
X		;;
X	-m)
X		wmrc=$2
X		shift ; shift
X		;;
X	-m*)
X		wmrc=`expr "$1" : '-m\(.*\)'`
X		shift
X		;;
X	-x)
X		xinitrc=$2
X		shift ; shift
X		;;
X	-x*)
X		xinitrc=`expr "$1" : '-m\(.*\)'`
X		shift
X		;;
X	--)
X		shift
X		break
X		;;
X	-*)
X		echo "$usage" 1>&2 
X		exit 1
X		;;
X	*)
X		break
X		;;
X	esac
Xdone
X
Xif [ $# -gt 0 ]; then
X	echo "$usage" 1>&2 
X	exit 1
Xfi
X
Xif [ "" != "${xinitrc-}" ]; then 
X	if [ "" != "${wmrc-}" ]; then 
X		echo "$usage" 1>&2 
X		echo -n "Window manager option unexpected " 1>&2
X		echo "with X startup option." 1>&2
X		exit 1
X	fi
X	if [ "" != "${xdefaults-}" ]; then 
X		echo "$usage" 1>&2 
X		echo "X resources option unexpected with X startup option." 1>&2
X		exit 1
X	fi
Xfi
X
XTTYNAME=`tty | sed -e "s/\/dev\///"`
X
Xif [ "${WFLAG-}" = "" ]; then
X	case "$TTYNAME" in
X	console | co)
X		WFLAG="true"
X		DFLAG="false"
X		;;
X	*)
X		DFLAG="true"
X		WFLAG="false"
X		;;
X	esac
Xfi
X
X/**/#
X/**/#	Find a xrdb(1L) configuration file.
X/**/#
X
Xxrdbconfigs="${xdefaults-} .Xdefaults .xdefaults .Xresources .xresources"
X
Xfor config in $xrdbconfigs; do
X	if [ -r $config -a -s $config ]; then
X		xrdbconfig="$config"
X		break;
X	fi
Xdone
X
X/**/#
X/**/#	Find a X configuration file.
X/**/#
X
Xxconfigs="${xinitrc-} ${XINITRC-} .Xinit .xinit .Xinitrc .xinitrc .xsession"
X
Xfor config in $xconfigs; do
X	if [ -r $config -a -s $config ]; then
X
X		xconfig="$config"
X
X/**/		#
X/**/		# Determine the shell of the X config file.
X/**/		#
X
X		if [ "`head -1 $xconfig | grep "/bin/sh"`" ]; then
X			shell="/bin/sh"
X		else
X			shell="/bin/csh"
X		fi
X
X		break;
X	fi
Xdone
X
X/**/#
X/**/#	Find a window manager configuration file.
X/**/#
X
Xwmgrconfigs="${wmrc-} .twmrc .awmrc .uwmrc"
X
Xfor config in $wmgrconfigs; do
X	if [ -r $config -a -s $config ]; then
X		wmgrconfig="$config"
X		break;
X	fi
Xdone
X
X/**/#
X/**/#	Determine which error file to use.
X/**/#
X
Xxerrors=${XERRORS=.xerrors}
X
X/**/#
X/**/#	Does the user know which DISPLAY to send to? 
X/**/#
X
Xif [ "${DFLAG-}" = "true" -a "${DISPLAY-}" = "" ]; then
X	export DISPLAY
X	DISPLAY=`who am i | sed -e 's/\(.*\)(\(.*\))/\2/'`:0
X	echo "Environment variable DISPLAY was set to $DISPLAY"
Xelif [ "${WFLAG-}" = "true" -a "${DISPLAY-}" = "" ]; then
X	export DISPLAY
X	DISPLAY=`hostname|sed -e 's/\.edu$//' -e 's/\.purdue$//' -e 's/\.cc$//'`:0
Xfi
X
X/**/#
X/**/#	Start X.
X/**/#
X
Xif [ "${xconfig-}" != "" ]; then
X	if [ -r $xconfig -a -s $xconfig ]; then
X		if [ "${WFLAG-}" = "true" ]; then
X			xinit /bin/sh -c "DISPLAY=$DISPLAY $shell $xconfig" \
X			> $xerrors 2>&1; kbd_mode -a; clear
X			exit 0
X		else
X			echo -n "Suspend your telnet(1C) session and wait for "
X			echo    "the window manager."
X			($shell $xconfig > $xerrors 2>&1 &)
X			exit 0
X		fi
X	fi
Xfi
X
Xif [ "${WFLAG-}" = "true" ]; then
X	(xinit /bin/sh -c "DISPLAY=$DISPLAY xterm -C" > $xerrors 2>&1; \
X	kbd_mode -a; clear &)
X	sleep 10
X	if [ -r .xauth -a -s .xauth ]; then
X		xhost + > $xerrors 2>&1
X	fi
Xelse
X	echo "Suspend your Telnet(1C) session and wait for the window manager."
Xfi
X
Xcase "$wmgrconfig" in
X.awmrc)
X	(awm > $xerrors 2>&1 &)
X	;;
X.uwmrc)
X	(uwm > $xerrors 2>&1 &)
X	;;
X.twmrc | *)
X	(twm > $xerrors 2>&1 &)
X	;;
Xesac
X
Xif [ "${xrdbconfig-}" != "" ]; then
X	xrdb $xrdbconfig > $xerrors 2>&1
Xfi
X
Xif [ "${WFLAG-}" = "true" ]; then
X	wait
Xelse
X	(xterm > $xerrors 2>&1 &)
Xfi
END_OF_FILE
if test 5821 -ne `wc -c <'startx/startx.cpp'`; then
    echo shar: \"'startx/startx.cpp'\" unpacked with wrong size!
fi
# end of 'startx/startx.cpp'
fi
if test -f 'startx/startx.newsletter' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'startx/startx.newsletter'\"
else
echo shar: Extracting \"'startx/startx.newsletter'\" \(10122 characters\)
sed "s/^X//" >'startx/startx.newsletter' <<'END_OF_FILE'
X.\" 
X.\" ltroff -tbl -pic startx.newletter
X.\" 
X.\" 
X.\" eqn tbl
X.\" 
X.nr O 1i
X.nr W 6.5i
X.so /usr/lib/tmac/tmac.m
X.fp 4 HX
X.de TP
X.vs 12
X.sp 2
X.sp .5
X.ps 16
X.if e 'tl '\f(HXannouncements''\fR'
X.if o 'tl '''\f(HXannouncements''\fR'
X.sp -2
X.ps 160
X.tl '\fB___'___'___\fR'
X.sp 6
X..
X.BS
X.ps 80
X\l'6.5i'
X.ps 10
X.sp 1
X.BE
X.EF "'\s+6\f(HX%\s-4''PUCC Newsletter\fR\s-2'"
X.OF "'\s+2\f(HXNovember 1989''\s+4%\fR\s-6'"
X.EQ
Xdelim off
Xgfont italic, gsize 10
X.EN
X.S 10 12
X.nr Pi 5
X.nr Pt 1
X.SA 1
X.de HX
X.if \\n(;1=1 \{\
X.sp 2
X.ps 80
X\l'2.75'
X.ps 10
X.ft HX
X.sp .15\}
X.if \\n(;1=1 .vs 18
X..
X.de HZ
X.vs 12
X.sp .5
X..
X.ds HP 16 16 16 16 16 16 16
X.ds HF 4 1 1 1 1 1 1
X.HM 1 1 1 1 1 1 1
X.nr Hb 5
X.nr Hs 5
X.nr Hi 1
X.nr Hc 0
X.nr Hu 1
X.nr Cl 7
X.nr Ci 10 5 5 5 5 5 5
X.de ES
X.ft CW
X'in +3
X.nf
X.S 9 10
X'sp .75
X..
X.de EE
X.if "\\$1""  .sp .75  \" spacing before regular following text
X.if "\\$1"1" .sp .75  \" spacing before regular following text
X.if "\\$1"2" .sp .25  \" spacing before paragraph .P
X.if "\\$1"3" .sp 0    \" 0 extra spacing before subheading
X.\" takes one argument (null, 1, 2, or 3) to determine spacing 
X.\" after example end
X.S 10 12
X'in
X.ft R
X.fi
X..
X.de )k
X..
X.2C
X.bp
X.1C
X.PS
Xbox wid 6.5i ht 2.5i
X.PF
X.sp 1.5
X.ll -2
X.in +2
X.ce
X\s+2\f(HXThe Syntax of the Startx UNIX Utility and Its Options\fR\s-2
X.sp
XThe syntax of the UNIX \fIstartx\fR command and its options is
X.ES
Xstartx [\|-d | -w\|] [\|-x \fIstartup\fP | [\|-r \fIresources\fP | -m \fIwindow_manager\fP\|] ]
X.EE
Xwhich represents two sets of options.  The first set consists of
Xthe options \fB-d\fR
Xor \fB-w\fR which helps \fIstartx\fR
Xdistinguish which type of terminal you are using.
XThese options will only be used in rare circumstances and you
Xshould consult the manual page for more details.
X.sp
XThe second
Xset of options consists of a choice between setting up your
XX Windows System environment with one shell script file
Xusing the \fB-x\fR option,
Xor by specifying your X resources and window manager separately
Xusing the \fB-r\fR and \fB-m\fR options.
XYou should note that you can use one or both
Xof the \fB-m\fR and \fB-r\fR options,
Xor the \fB-x\fR option,
Xbut you cannot use the \fB-x\fR option
Xin conjunction with the \fB-m\fR and \fB-r\fR options.
X.ll +2
X.in -2
X.PE
X.sp 2
X.2C
X.HU "Startx UNIX Utility Makes the X Windows System Easy"
X\fRThe \fIX Windows System\fR is
Xa network-based, graphics window system which
Xwas developed at MIT in 1984.
XThe most recent version, X11, was 
Xreleased in 1987,
Xand is the version we currently have running.
XThe X Windows System is available on all of our Sequent Symmetries
Xrunning the DYNIX operating system, Sun workstations running SunOS,
Xand the VAX 8800 running the ULTRIX operating system.
X.P
XThere are many ways to initiate an X Windows System session
Xwhich require you to go through several steps to create a working
Xenvironment.
XThe \fIStartx\fR UNIX utility
Xis designed to ease your burden
Xby allowing you to start your window manager,
Xdefine and load your X resources, and
Xinitiate other X clients in one command.  
X.sp
X\fBWindow Managers, X Resources,
X.br
XX Servers and X Clients\fR
X.sp
XIn order for you to understand how \fIstartx\fR works it is important
Xthat you know the meanings of the terms \fIwindow manager, X resources, 
X\fIX server\fR and \fIX clients\fR.
X.BL 2
X.LI
XA \fIwindow manager\fR is a program which allows you to move, resize and
Xcirculate windows on your display.
XThese windows act like individual
Xscreens which you can manipulate, layer and move around.
X.LI
X\fIX resources\fR are personalized 
Xattributes of your environment such as color, cursor symbol, etc.  
XYou can tailor your X Windows Session environment to make the cursor 
Xsymbol change when moved to other windows, make a scroll bar,
Xor make the windows change
Xcolors for easier identification.  These are just a few examples of
X\fIX resources\fR.
X.LI
XYour \fIX server\fR communicates and translates all input so that your
Xparticular display can understand all the information it receives.
XIt is a combination of the graphics display, keyboard,
Xmouse, hardware, and X server software which accepts input from these
Xdevices and provides display services for clients.
XThe \fIX server\fR software must run locally in order to communicate
Xwith these devices.  
X.LI
X\fIX clients\fR are programs that perform tasks 
Xsuch as terminal emulation or window management
Xto shape your X Windows System environment.
X.LE
X.sp
X\fIStartx\fR sets your
XDISPLAY environment variable
Xto identify the X server to the X clients.
XThis enables your X clients to communicate with it
Xand set up your X Windows System session.
X.sp
XYou can find out more about your environment variables
Xby checking the man pages of the UNIX shell you are using
X(\fIsh\fR(1), \fIcsh\fR(1), or \fIksh\fR(1L))
Xor by asking a PUCC general consultant for assistance.
X.sp
X\fBCreating a Startup Shell Script File\fR
X.sp 
XYou can define and load your X resources 
Xand your window manager easily using a
Xstartup shell script file.
X\fIStartx\fR reads this file if you use the \fB-x\fR option
Xon the command line,
Xif you name the file in your XINITRC environment variable, or
Xif you named the 
Xfile\fI .Xinit, .xinit, .Xinitrc, .xinitrc\fR, or \fI.xsession\fR.
XIn this file, 
Xit is your responsibility to start
Xa window manager, load X resources and create X clients.
XA working example of a startup shell script file
Xfollows:
X.ES
X.in -.5i
X#!/bin/csh
X(twm &)
Xxrdb -load .xdefaults
X(xclock -g 75x75+0+0 &)
X(xbiff  -g 75x75+101-0 &)
Xif ("/dev/console" == "`tty`") then
X\ \ xterm -g 80x24+0+0 +ut -C -T `hostname`
Xelse
X\ \ xterm -g 80x24+0+0 +ut -T `hostname`
Xendif
X.EE 1
X.in -.5i
XFor a workstation, it is important that
Xthe last line in your startup shell script file
Xbe \fIxterm\fR(1L)
Xrunning in the foreground with the \fB-C\fR option for console
Xmessages.
X.sp
XFor an X display station, the last line in the startup script
Xshould be \fIxterm\fR(1L) running in the foreground
X\fIwithout\fR the \fB-C\fR option.
XBe aware that some X display stations will not
Xterminate the \fItelnet\fR(1C) session on closing,
Xtherefore, you should remember to manually logoff
Xthe session before going to,
Xor after leaving,
Xthe X Windows session.
X.sp
XNow that you know what a startup file looks like
Xyou can tell \fIstartx\fR to read this file in one of three ways.
X.BL 2
X.LI
X\fRYou can use the \fB-x\fR option and a startup
Xshell script file to invoke \fIstartx\fR
Xby entering
X.ES
Xstartx -x \fIstartup
X.EE 2
XIn this example, \fIstartx\fR will run the given shell script file,
X\fIstartup\fR.
X\fIStartx\fR looks for a file specified with the \fB-x\fR option
Xbefore looking for any other initialization files.
X.LI
X\fRYou can set your XINITRC environment variable to the
Xstartup shell script file name you want to use.
XIf you don't give any startup shell script file name
Xat the command line using the \fB-x\fR option,
Xthen \fIstartx\fR looks for a startup shell script
Xfile named by your XINITRC 
Xenvironment variable.  
X.sp
XAgain, you can find out more about setting your environment variables
Xby checking the man pages of the UNIX shell you are using
X(\fIsh\fR(1), \fIcsh\fR(1), or \fIksh\fR(1L))
Xor by asking a PUCC general consultant for assistance.
X.LI
XYou can name your startup shell script 
Xfile \fI.Xinit, .xinit, .Xinitrc, .xinitrc,\fR 
Xor \fI.xsession,\fR to begin the X client programs.
XIf you haven't used the \fB-x\fR option or set XINITRC,
Xthen \fIstartx\fR
Xlooks in your home directory for any file with the above
Xnames in their respective order.
XIt looks for these file names 
Xspecifically because they
Xare the most common names for initialization files, however,
Xwe recommend using the name \fI.xsession\fR
Xfor your startup shell script file. 
X.LE
X.sp
X\fBDefining X Attributes Without a Startup File\fR
X.sp
X\fRIf \fIstartx\fR doesn't find a startup 
Xshell script file, it 
Xloads a \fIresources\fR file which you supply at the command line
Xusing the \fB-r\fR option. 
XThis is done by entering
X.ES
Xstartx -r \fIresources 
X.EE 1
Xwhere \fIresources\fR is the name of the X resources configuration
Xfile you wish to use.
X(See the \fIxrdb\fR(1L) and \fIx\fR(1L) man pages
Xfor more information on X resources.)
X.sp
XIf you don't use the \fB-r\fR option, \fIstartx\fR looks for 
Xa file in your home directory 
Xcalled \fI.Xdefaults, .xdefaults, .Xresources,\fR 
Xor \fI.xresources,\fR respectively.
XIf it doesn't find any of these X resource files,
Xthen your X Windows System session will not have personalized
Xattributes.
X.sp
X\fRAgain, if no startup shell script file
Xis specified using the \fB-x\fR option, \fIstartx\fR 
Xlooks for a window manager
Xindicated at the command line using the \fB-m\fR option.
XThis is done by entering
X.ES
Xstartx -m \fIwindow_manager
X.EE 2
XIf you don't use the \fB-m\fR option, then
X\fIstartx\fR invokes the 
Xwindow manager \fItwm\fR(1L), \fIawm\fR(1L), or \fIuwm\fR(1L) if it finds
Xan associated configuration file 
Xin your home directory named \fI.twmrc, .awmrc,\fR 
Xor \fI.uwmrc\fR, respectively.
XIf \fIstartx\fR can't find such a window manager configuration 
Xfile in your home directory, it initiates 
Xan \fIxterm\fR(1L) client and the \fItwm\fR(1L) window manager
Xby default.
X.sp
X\fBTracing Errors\fR
X.sp
XNot only does \fIstartx\fR start all your X clients for you, it also 
Xredirects error messages into a file
Xfor any errors encountered 
Xwhile trying to start your X Windows System session.
XIf you set your environment variable XERRORS
Xto the name of an errors file you want, \fIstartx\fR will redirect the
Xerror messages to that file.
X.sp
XIf you don't set your XERRORS environment variable,
X\fIstartx\fR
Xcreates an errors file called \fI.xerrors\fR in you home directory
Xand redirects any error messages to that file by default.
X.sp
X\fBAdditional References\fR
X.sp
XFor more information on the X Windows System see
Xthe \fIX Window System User's Guide, Volume Three,\fR 
Xby O'Reilly & Associates, Inc.
XThis manual is available for loan
Xat the PUCC Reference/Loan Library in MATH B6.
XFor a general overview of the X Windows System
Xconsult the November 1989 issue of the \fIPUCC Newsletter\fR. 
X.sp -.5
X.TS
Xrw(3.06i) .
X\(em \fIGeorge Kraft &\fR
X\fIMichael Melton\fR
X.TE
END_OF_FILE
if test 10122 -ne `wc -c <'startx/startx.newsletter'`; then
    echo shar: \"'startx/startx.newsletter'\" unpacked with wrong size!
fi
# end of 'startx/startx.newsletter'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have the archive.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0