views:

206

answers:

1

I want to write a software, when monitor connect with D-sub connector, this software will pop-up, and ask user to mirror monitor or extend monitor.

but i doesn't find any event emit when d-sub connect. on Windows vista, if you connect a monitor, vista can pop-up a software to same thing.

does anybody know how to detect d-sub connect event and handle it in linux?

thanks lots!

+2  A: 

Under the traditional architecture of the graphics systems in Linux (some direct rendering management in the kernel but everything else driven by a userspace X11 server), the kernel is unable to detect new monitors (because it has given up control of the hardware) and X is unable to detect new monitors (because a userspace program cannot handle hardware interrupts). You can trigger X to search for changes in adapter configuration with xrandr --auto.

There is a redesign of the graphics stack underway, search for "kernel modesetting". Under the new scheme, properly written drivers will emit a uevent for a hotplugged adapter. Running udevmonitor --env should show a hotplug event under /sys/class/drm/card[n].

ephemient