I know someone mentioned this at a distant past MUUG meeting; what is the command line tool that will query the attached monitor for its settings? I believe this is called DDC?
I have a laptop and I'd like to have a command line tool that can detect if a second monitor is attached.
Any tips?
John
John Lange wrote:
I know someone mentioned this at a distant past MUUG meeting; what is the command line tool that will query the attached monitor for its settings? I believe this is called DDC?
If you're looking for the low level bit, I think read-edid is what you're looking for.
However, if you're on a modern xorg based distro, xrandr is a good one:
oin$ xrandr -q SZ: Pixels Physical Refresh *0 1280 x 1024 ( 342mm x 271mm ) *75 60 1 1024 x 768 ( 342mm x 271mm ) 75 70 60 2 832 x 624 ( 342mm x 271mm ) 75 3 800 x 600 ( 342mm x 271mm ) 75 72 60 56 4 640 x 480 ( 342mm x 271mm ) 75 73 60 5 1280 x 960 ( 342mm x 271mm ) 60 6 1280 x 800 ( 342mm x 271mm ) 60 7 1152 x 864 ( 342mm x 271mm ) 75 8 1280 x 768 ( 342mm x 271mm ) 60 9 1152 x 768 ( 342mm x 271mm ) 55 10 416 x 312 ( 342mm x 271mm ) 75 11 400 x 300 ( 342mm x 271mm ) 75 72 60 Current rotation - normal Current reflection - none Rotations possible - normal Reflections possible - none
xrandr will allow you to do all sorts of cool things. If it's an intel chipset, you can switch monitors, etc etc etc.
Scott
Thanks Scott.
read-edid does not seem to exist on my system.
And I don't think xrandr is what I need. It seems to report your current settings and allow you to change things.
As you can see from this output, I've got two monitors connected in xinerama mode (thus the 2800 x 1050 resolution) but there is no indication from the output about the second monitor.
# xrandr -q SZ: Pixels Physical Refresh *0 2800 x 1050 ( 757mm x 303mm ) *60 1 1400 x 1050 ( 757mm x 303mm ) 60 2 1280 x 1024 ( 757mm x 303mm ) 60 47 43 3 1152 x 864 ( 757mm x 303mm ) 60 47 43 ...
What I'm trying to do is have the laptop detect when a second monitor is connected during boot and automatically put the system into xinerama mode. When no monitor is detected it should default to clone mode.
Currently this is strictly a manual process for me now during boot but its a bit of a pain.
From playing around with MythTV I know the video card has the ability to
detect what devices are connected. I just need to figure out the command line way of getting this information.
Regards,
John
On Wed, 2007-07-11 at 13:05 -0500, Scott Balneaves wrote:
John Lange wrote:
I know someone mentioned this at a distant past MUUG meeting; what is the command line tool that will query the attached monitor for its settings? I believe this is called DDC?
If you're looking for the low level bit, I think read-edid is what you're looking for.
However, if you're on a modern xorg based distro, xrandr is a good one:
oin$ xrandr -q SZ: Pixels Physical Refresh *0 1280 x 1024 ( 342mm x 271mm ) *75 60 1 1024 x 768 ( 342mm x 271mm ) 75 70 60 2 832 x 624 ( 342mm x 271mm ) 75 3 800 x 600 ( 342mm x 271mm ) 75 72 60 56 4 640 x 480 ( 342mm x 271mm ) 75 73 60 5 1280 x 960 ( 342mm x 271mm ) 60 6 1280 x 800 ( 342mm x 271mm ) 60 7 1152 x 864 ( 342mm x 271mm ) 75 8 1280 x 768 ( 342mm x 271mm ) 60 9 1152 x 768 ( 342mm x 271mm ) 55 10 416 x 312 ( 342mm x 271mm ) 75 11 400 x 300 ( 342mm x 271mm ) 75 72 60 Current rotation - normal Current reflection - none Rotations possible - normal Reflections possible - none
xrandr will allow you to do all sorts of cool things. If it's an intel chipset, you can switch monitors, etc etc etc.
Scott
John Lange wrote:
Thanks Scott.
read-edid does not seem to exist on my system.
Dunno what distro you've got there, but on Debian/Ubuntu it's an installable package.
Google seems to indicate read-edid is a Fedora package as well, so you may need to install it.
Cheers, Scott
Unfortunately this is OpenSUSE and it does not appear to be available as a package.
I know there is a command installed already that does this I just can't seem to figure out what it is.
Perhaps it's a tool that I have to get from ATI...
John
On Wed, 2007-07-11 at 13:32 -0500, Scott Balneaves wrote:
John Lange wrote:
Thanks Scott.
read-edid does not seem to exist on my system.
Dunno what distro you've got there, but on Debian/Ubuntu it's an installable package.
Google seems to indicate read-edid is a Fedora package as well, so you may need to install it.
Cheers, Scott
To answer my own question from a while back:
The command is dccprobe.
So something like:
dccprobe |grep "analog signal"
Will tell you if you have a second monitor attached.
For debian/ubuntu (and I assume Fedora) fans, there is some good information here:
http://ubuntufan.wordpress.com/2006/10/06/detecting-dual-displays/
I put the (modified) script from that page in:
/etc/init.d/boot.local
And it works like a charm!
But SUSE does not include dccprobe so you will have to find dccprobe source and compile it yourself. I actually just used the source from the debian package (because I couldn't find it any place else):
http://packages.debian.org/unstable/source/xresprobe
Just untar, cd dccprobe, make. Then copy ddcprobe to someplace useful like /usr/local/sbin/
Now when I boot my laptop it automatically goes into either Xinerama mode, or clone dual-head mode depending on if I have another monitor attached or not.
I also have two small scripts that I can use to force it one way or the other if I plug in a monitor after booting.
John
On Wed, 2007-07-11 at 12:21 -0500, John Lange wrote:
I know someone mentioned this at a distant past MUUG meeting; what is the command line tool that will query the attached monitor for its settings? I believe this is called DDC?
I have a laptop and I'd like to have a command line tool that can detect if a second monitor is attached.
Any tips?
John
Roundtable mailing list Roundtable@muug.mb.ca http://www.muug.mb.ca/mailman/listinfo/roundtable