Subject: Re: X Resolutions
To: None <tech-x11@netbsd.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-x11
Date: 10/27/2002 16:26:43
On Sun, 27 Oct 2002, Soren S. Jorvang wrote:
> On Sun, Oct 27, 2002 at 04:04:14AM -0500, Andy Ball wrote:
> > Is there some way to ask X what resolution it thinks I'm
> > running in?
> xdpyinfo | grep resolution
> > Or to tell it what I'm really running?
> X -dpi x

I don't know how platform-dependent this is, but on an i386 with
XFree86 you can put a "DisplaySize" line in the "Monitor" section of
the XFree86Config file, to tell it the useful size of the viewable
surface (e.g.  "DisplaySize 299 226" means 299 by 226 millimetres).
Then the X server can combine that with knowledge of the display
mode (e.g. 1024x768) to calculate the resolution (e.g. 3.4 dots per
millimetre or 87 dots per inch), and xdpyinfo can report that calculated
resolution.

--apb (Alan Barrett)