Originally posted by R00ts
What about .xsession? I was trying to do this a little while ago using wdm (not gdm) to set some environmental variables and found that it didn't work when I put them in .xinitrc, but it did work in .xsession. Hmm I dunno. Maybe I forgot to put #!/usr/bin/bash in the xinitrc one and not the xsession one, who knows.
Do you use a graphical login manager, or startx? .xinitrc is only used when you type startx.
As far as opening programs automatically when X is started, putting "exec some_app &" into .xinitrc will work, but for WM's like GNOME and XFCE that have "sessions", it's generally better to add those apps you want autostarted to your desktop environments session so that it is started that way. In GNOME, in the menu, go to sessions, and then then add the app there, in XFCE, just open it in XFCE, then log out and check the box to save the session. It will then automatically open the next time you start it.