SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'd like to query my monitor to change my xorg.conf file on-the-fly. I have a box that I connect to two different monitors. One is a 1680x1050 monitor (DVI-D), the other is 1920x1080 HDTV (HDMI). I'd like to extract/parse the monitor name to use the correct xorg.conf.
This is with 13.0 32-bit. I'm using NVIdia 185.18.31 proprietary drivers. As this is the new X system, my xorg.conf is minimal only to support the proprietary drivers.
I looked at xorgsetup, which basically is a wrapper for 'X -configure'. I don't want to create a new xorg.conf, just extract/parse the EDID info from the monitor in a human readable manner.
Perhaps the easiest solution is to let 'X -configure' create a new xorg.conf, extract the monitor name, delete the new xorg.conf, and install the correct pre-made xorg.conf.
I admit that with the new X I might not need this information, but what the heck.
Another reason for knowing this is so I can reconfigure Xine on-the-fly to use the correct audio port (HDMI or external speakers).
Doesn't that information (VendorName and ModelName) appear in the Monitor section of xorg.conf? If so, are you asking for a script which will extract (using eg SED, AWK, etc) and print the information?
If so, are you asking for a script which will extract (using eg SED, AWK, etc) and print the information?
No, I want to extract the information from the monitor so I can use the correct xorg.conf before starting X. I have two prebuilt xorg.conf files, one for each monitor. I swap the files before starting X when I move the machine. I started doing this long ago when I wanted to swap video drivers, say toggling between nv and nvidia. Was much faster and handier than always manually editing xorg.conf.
You might try using a program called 'ddcxinfo' but I was unable to 'make' it on Slackware 13.
The following commands will use Xorg to probe the monitor and output a line of EDID data which should uniquely identify each of your monitors (and not change over time). The outputted line contains the manufacturer, model, and serial number -- though it is encoded in hexadecimal format.
The approach is rather ugly and may not suit your purposes, but I thought I'd post it just in case.
Code:
Xorg :1 -logverbose 10 -probeonly
sed '1,/EDID (in hex)/d' /var/log/Xorg.1.log |head -c 40
Actually, the probeonly option might suffice. Although I get different results depending upon which version of X I'm using. Regardless, the info I need from the resulting Xorg.x.log is available.
I notice there is one consistent snippet regardless of which monitor or computer I run the probe, or which version of X:
(--) NVIDIA(0): Connected display device(s) on GeForce 6150 at PCI:0:5:0:
(--) NVIDIA(0): Samsung SyncMaster (CRT-0)
or:
(--) NVIDIA(0): Connected display device(s) on GeForce 8300 at PCI:2:0:0:
(--) NVIDIA(0): Acer X193W+ (DFP-0)
The Samsung is an LCD monitor but uses the VGA adapter, hence the CRT designation. I haven't yet tested this probing with the HDTV.
From there I can use grep to return a line number for the "Connected display device..." line. For example, line 447. Then I can run 'head -448 /var/log/Xorg.1.log | tail -1' to extract line 448.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.