Friday, July 27, 2007

Getting X display info easily

When editing my X display configuration, I sometimes want to know what resolution is actually being displayed, as compared to what I have set in xorg.conf. An easy command to do this: xdpyinfo. This command is designed to provide X display information, just what I want!

The most common things I need are resolution and DPI. Here are examples of these:

$ xdpyinfo | grep resolution
resolution: 90x88 dots per inch
$ xdpyinfo | grep dimensions
dimensions: 3360x1050 pixels (948x303 millimeters)

This tells me just what I need to see to confirm if what I am trying to set in the X config is manifesting or not.

Of course, if you want to do it the hard way, you can use the Pythagorean theorem, and divide the diagonal pixel resolution of your screen ( equal to the square root of the width squared plus the height squared) by diagonal size of your screen in inches... I'll take the command.

2 Comments:

Blogger Duncan McGreggor said...

Or you could just do it in one shot:

$ xdpyinfo | egrep 'resolution|dimensions'

July 28, 2007 at 10:38 PM  
Blogger by Immortal Curiosity said...

True 'nuff:-) I don't usually need both at once though, so I split out the examples.

Although, now that I am thinking of it, it might be handy to alias the combined form, as "displaystats" or something.

July 29, 2007 at 12:50 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home