How can I determine X resolution from CLI without randr?

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


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


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:'