I am using my laptop in several monitor configurations that do require xorg.conf (say, I am driving a T221 from my laptop) and it's very inconvenient to manually switch them. Is there something in /sys which tells me if something is plugged into a DVI connector? Or a utility or ...?

  • How do you start the X server? (Using gdm/kdm/slim etc. or startx? If you use *dm method, what type of session do you use? What desktop env.?) Sep 21, 2011 at 9:23
  • I am using kdm not sure about session -- just default?
    – chx
    Sep 22, 2011 at 20:29

2 Answers 2


I would start by looking at hwinfo:

$ hwinfo --monitor
51: None 00.0: 10000 Monitor                                    
  [Created at fb.71]
  Unique ID: rdCR.EY_qmtb9YY0
  Hardware Class: monitor
  Model: "Generic Monitor"
  Vendor: "Generic"
  Device: "Monitor"
  Resolution: 1920x1200@77Hz
  Driver Info #0:
    Max. Resolution: 1920x1200
    Vert. Sync Range: 50-90 Hz
    Hor. Sync Range: 31-96 kHz
  Config Status: cfg=new, avail=yes, need=no, active=unknown

You might also look into using xrandr to control which displays are in use.

  • Unbelievable. Just unbelievable. Exactly what I needed.
    – chx
    Oct 2, 2011 at 7:22
  • Could you specify which package contains hwinfo in your distribution?
    – manatwork
    Oct 2, 2011 at 11:01
  • It is just called hwinfo on Ubuntu.
    – polynomial
    Oct 2, 2011 at 15:55
  • Unfortunately it doesn't work on all hardware and/or configurations. For some reasons some systems with monitors attached display nothing for me. But still a good suggestion. Apr 21, 2012 at 0:59

Note that this broke with the latest Arch Linux upgrade, however the directory /sys/class/drm/ contains all the video outputs. I use head -1 /sys/class/drm/card0-HDMI-A-3/modes to detect the existence of the 3840x2400 mode but one could just check /sys/class/drm/card0-HDMI-A-3/status for connected vs disconnected if the mode was not important which is the exact and fastest answer to my question :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .