Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Does anyone know of a way to determine the current X resolution from the command line, without using randr?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

you can grep output of xdpyinfo or xwininfo -root or xprop -root.

share|improve this answer
    
Perfect, thanks! I wound up using "xdpyinfo | grep dimensions" –  Brad Aug 24 '11 at 21:24

I'm not sure if xdpyinfo uses RANDR:

xdpyinfo | grep dimensions:

This one assumes the root window's size is the resolution:

xwininfo -root |egrep 'Width:|Height:'
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.