Netra j 2.0 Administrator's Guide

Structure of xgotoken-init

The xgotoken-init is based on the standard openwin-init file, with the addition of the following section:


case "$GG_TOKEN" in
    xterm)
	if [ "$OW_WINDOW_MANAGER" = ':' ]; then
	   toolwait=
	else
	   toolwait=toolwait
	fi
	$toolwait $OPENWINHOME/bin/xterm
        exit
	;;
    *)
	echo warning: /usr/openwin/lib/xgotoken-init: \'$GG_TOKEN\': case not found.
	echo using defaults...
	;;
esac

This section parses the $GG_TOKEN (with any prefixed wm= or nowm flags removed) and starts the appropriate clients. In this example, only one token, xterm , is defined. Any other token will return an error and use the default OpenWindows startup.

Note the handling of the $toolwait variable. In Xgotokenrc, if nowm is specified, it sets the $OW_WINDOW_MANAGER variable (in conformance to the standard OpenWindows method of specifying an alternate window manager) to the colon. This results in no window manager being executed when the shell interprets the colon as an empty command.

Modify the $toolwait variable, if there is a window manager running, the toolwait program starts xterm (which will run in the background). When no window manager is running, the last client started by xgotoken-init must not run in the background, or the GlobalInit program will think that the session is over and will shut down the X server. Conditionally running toolwait solves this problem.