Let me preface my question with the following: I am pretty sure that I can hack together a solution by modifying /usr/share/xsessions/somesessionfile.desktop and make it run /etc/X11/Xsession, and get it to work that way, but I would still like to clear a few things up.
Setup: 12.04, completely fresh installation(3 hours old, maybe). Want to use xmonad as my WM. Dual-head setup.
My question: I am thoroughly, or rather utterly, confused about which program is doing what, regarding X , unity, login managers(or whatever they are called) and window managers. I am using xmonad as my window manager, I know this much. And when I log in, or perhaps even earlier, I want my dual monitors to be set up properly using a script that runs xrandr(that I already have working). Everyone I talk to or whose questions I read online talk about xinitrc, ~/.xsession or /etc/X11/xsession, but none of these files are being run. The files in /usr/share/xsesssions seem to be the only files that are being run, and I cannot for the life of me find any documentation about any of this.
Where is the consistency in this system? What, exactly, am I supposed to do if I want to do this properly? Some window managers seem to do this(KDE and gnome seem to have something just called 'autostart'). Am I supposed to let my window manager handle this, X, or lightdm? I understand there are probably dozens of files in the startup process that I could possibly put this in, but I'm asking for the proper convention. What is the solution, for something like this?
TL;DR; Is there one, consistent way for me to run a script automatically for every window manager that runs on top of X, or does this depend entirely upon the combination of window managers and login managers I am using?