Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking for a method of reporting display resolution. I want to set up scripts to launch rdesktop, and I want to launch it on several machines with different resolutions, so I want a way to dynamically determine it.

share|improve this question

3 Answers

up vote 8 down vote accepted

Use the command xrandr. Without any argument it displays the available resolutions and the current one (with an asterisk).

share|improve this answer
Could you append some sample output to the answer? And I'm guessing xrandr |g grep \* does the trick? – shurane Apr 26 at 19:38

Alternative solution: xdpyinfo | grep dimensions. xdpyinfo is older than xrandr, so might be more portable if you happen to use a very old distribution or some different X server.

share|improve this answer

I should have looked a little harder before posting. xrandr will echo the current display settings, if not given any other arguments.

By default, this will dump all possible display settings, this can be filtered as follows:

xrandr | egrep '^[^ ]|[0-9]\*\+'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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