isn't that what .xinitrc is for? I may be misunderstanding your question, but in general when the X window system starts up, it checks for the .xinitrc file in the user's home directory. It will then execute what is in that. For instance, I have this:
xpenguins -n 36 &
which will execute the xscreensaver (starting it up), then xpenguins (giving me a bunch of crazy penguins running around everywhere
) and then finally starting my window-manager (enlightenment).
-- the dudeman