#!/bin/sh userclientrc=$HOME/.xdfbrc userserverrc=$HOME/.dfbserverrc sysclientrc=/usr/X11R6/lib/X11/xinit/xdfbrc sysserverrc=/usr/X11R6/lib/X11/xinit/dfbserverrc serverargs="" clientargs="" if [ -f $userclientrc ]; then clientargs=$userclientrc else if [ -f $sysclientrc ]; then clientargs=$sysclientrc fi fi if [ -f $userserverrc ]; then serverargs=$userserverrc else if [ -f $sysserverrc ]; then serverargs=$sysserverrc fi fi display=:0 whoseargs="client" while [ "x$1" != "x" ]; do case "$1" in --) whoseargs="server" ;; *) if [ "$whoseargs" = "client" ]; then clientargs="$clientargs $1" else serverargs="$serverargs $1" case "$1" in :[0-9]*) display="$1" ;; esac fi ;; esac shift done if [ X"$XAUTHORITY" = X ]; then export XAUTHORITY=$HOME/.Xauthority fi removelist= # set up default Xauth info for this machine mcookie=`mcookie` for displayname in $display `hostname -f`$display; do if ! xauth list "$displayname" | grep "$displayname " >/dev/null 2>&1; then xauth add $displayname . $mcookie removelist="$displayname $removelist" fi done echo $serverargs xinit $clientargs -- $serverargs if [ x"$removelist" != x ]; then xauth remove $removelist fi if command -v deallocvt > /dev/null 2>&1; then deallocvt fi