The reverse of what you're talking about, a thread I posted a few days ago and my trials and tribulations at getting auto-start of X server and my full screen application at system boot:
Having Trouble Configuring to Autostart App in Xserver with no Display Manager.
A good reference I ran into for xorg.conf was:
http://www.x.org/archive/X11R6.8.0/doc/xorg.conf.5.html, that one helped me a lot.
From what I gathered:
1. startx can be called with some parameters, simple google searches helped me with that, although I did not know you could specify starting an app as an argument to startx, my intentions were to disable the mouse cursor because it is a touch screen application.
2. /usr/lib/X11/xinit/xinitrc - note not a DOT<name> file, just xinitrc, IS run when you load the X server. And it's a shell script, therefore when you put in stuff like:
Code:
#!/bin/sh
exec <path>/your-application
It will run your program, that's exactly what I did.
3. If you wish to disable things like power management, screen saver, and screen blanking, that all falls under the xorg.conf file.
I hope some of this helps. I guess I'm confused as to why you want to load the Xserver as part of your application, unless you want the Xserver to load in a special manner or to do so automatically without user intervention, excepting that they run an application.