user visible monitor hotplug events

Aaron Plattner aplattner at nvidia.com
Mon Oct 24 13:23:37 PDT 2011


On 10/24/2011 07:45 AM, Kai-Uwe Behrmann wrote:
> Hello,
> 
> what's the way to get monitor hotplug events in a user desktop session?
> I want to setup ICC profiles during monitor connections and
> deconnections. Currently this is done inside Compiz. But I want to put
> the setup code into a speperate application. Ideally this application
> would be called on demand.
> 
> Is DBus the right thing to register to? If yes, how?

RandR generates events when outputs change states.  You should listen for those events:

http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt?id=randrproto-1.3.2#n326

> Code examples are welcome too if any.

Michael Thayer's changes to xev to make it print the events might be a good place to start.

http://cgit.freedesktop.org/xorg/app/xev/commit/?id=7965bc6efbf5db244593735bbb98f0ffa759cd1a

-- Aaron


More information about the xorg-devel mailing list