main loop split into main_loop() function, cleaned up X init, preparation to use RandR
use RandR to get primary output size and position