#!/bin/ksh # start X with authority, assuming XDM is not running. PATH=/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin XAUTHORITY=$HOME/.Xauthority #LD_LIBRARY_PATH=/usr/X11R6/lib:/usr/lib:/usr/local/lib export PATH XAUTHORITY # generate random key; length must be even or xauth complains randomkey=$(echo $(( $RANDOM * $RANDOM * 2 )) | md5) xauth add $(hostname)/unix:0 . $randomkey xauth add $(hostname):0 . $randomkey # start X with authority exec xinit $HOME/.xinitrc -- /usr/X11R6/bin/X -auth $HOME/.Xauthority exit 0