I am making a script that needs to access the computer's monitor(s) configuration. How can I do that? Is there a command or a file I could read where I can access this information?

At the moment, I do

xwininfo -root

But I only have the total resolution and not the details (What I need is the resolution of each screen individually).


  • do you have access to the xserver while executing the script? do you want to know the limits of the hardware (the monitors)? do you want to know what resolutions are configure in Xorg.conf? – akira Jan 19 '11 at 15:19
  • I want to know what resolutions are configured in Xorg.conf, except that as I am running Fedora 14, by default I don't have a Xorg.conf. – nbarraille Jan 19 '11 at 15:34

If your video driver supports it, xrandr will display the available and current resolutions for all displays.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.