It seems like an simple problem, but I can\'t find the answer: How do you query (via X11) what monitors exist and their resolutions?
This might be helpfull for cli and scripting
xwininfo -root
But xRandR might be more accurate, especially, when there is multiple monitor environment:
xrandr