At the moment I'm writing a script that needs to know the resolutions and positions of all monitors used. I've tried using commands like xrandr but it's combining the resolutions of my two monitors into one screen "Screen 0". The only place I seem to be able to get the information from is directly from the xorg.conf file but writing a script to get the info out of the file is getting difficult. I started off by making the script work with my xorg.conf file and then many xorg.conf examples from the internet but there seem to be too many different ways the info can be entered in to the file.

Are there any easy ways of getting the resolutions and positions of all the monitors using some sort of command or at least some easy way of getting specific information out of the xorg.conf file?