Hi meo
What Paul_123 just said jogged my memory. When I switched the
laptop from Xorg to Xorg-3d, I changed from sleep to this:
Timeout=60
while [ $Timeout -gt 0 ]
do
[ -e /dev/dri/card0 ] && break
Timeout=$(($Timeout - 1))
sleep 0.25
done
/usr/local/bin/Xorg -nolisten tcp &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
----- Snip -----
That waits for 15 seconds or until /dev/dri/card0 shows up, whichever
comes first. The laptop usually continues after 8 seconds.
I found the issue was /dev/dri/card0 by searching /var/log/Xorg.0.log
for errors after failed in waitforX occurred.