Trying to get the resolution in a virtual display on Debian Squeeze, xrandr returns error:
 "extension missing on display"

Instead, use the xwininfo program:

width=`xwininfo -root | grep Width | awk '{ print $2}'`
height=`xwininfo -root | grep Height | awk '{ print $2}'`

 

Ref: http://www.debian-administration.org/articles/121

 

22 Apr 2011 / admin