#!/bin/sh

DISPLAY=":0"
XORG_CONF=" -config /etc/X11/xorg.conf -configdir /etc/X11/xorg.conf.d "
OTHER_OPTIONS=" -ac -noreset -r +accessx 0 vt07 -nocursor -sharevts"

udevadm trigger --subsystem-match=input &

[ -x /usr/bin/pvrsrvinit ] && /usr/bin/pvrsrvinit

if [ -e ~/.xinitrc ]; then
	XINITRC=~/.xinitrc
else
	XINITRC=/etc/X11/xinitrc
fi

XSERVER_OPTIONS=" ${DISPLAY} ${OTHER_OPTIONS} ${XORG_CONF} "

if [ "$1" = "--gdb" ]; then
	gdb --args Xorg ${XSERVER_OPTIONS}
else    
	if [ "$1" = "--only" ]; then
		Xorg ${XSERVER_OPTIONS} &
	else
		xinit ${XINITRC} -- /usr/bin/Xorg ${XSERVER_OPTIONS} &
	fi
fi    


