Fwd: Re: user visible monitor hotplug events

Michal Suchanek hramrach at centrum.cz
Tue Oct 25 15:22:47 PDT 2011

On 24 October 2011 23:49, Aaron Plattner <aplattner at nvidia.com> wrote:
> On 10/24/2011 02:39 PM, Kai-Uwe Behrmann wrote:
>> Am 24.10.2011 13:26, schrieb Aaron Plattner:
>>> On 10/24/2011 07:45 AM, Kai-Uwe Behrmann wrote:
>>>> 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
>> I read this from a nvidia developer. Does that mean XRandR-1.3 is going
>> to be supported soon in the nvidia driver?
> It's supported in the Tegra driver.
>>>> 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
>> This means, the setup application needs to stay active all the time like
>> a daemon, which I initially hoped to can circumvent.
> Yes.

Yes, there is no way to configure the X server. The X people refuse to
store configuration in the X server so you need a daemon to configure
every device as it is attached.

For some reason you can configure keyboard layout with udev but
nothing else can be configured in X.

You need a daemon to configure monitors, a daemon to configure input
devices, and a daemon to configure wacom tablets because the wacom
people can't agree with X people on a protocol that would allow
configuring Wacom tablets *and* other input devices.

You can only configure a device once connected and the configuration
is lost once disconnected unless a deamon is watching for device
hotplugs and reconfigures any new devices.

You can also write a configuration file which has completely different
syntax and option names from xrandr/xinput/xsetwacom and requires you
to restart the X session. Very consistent and practical. nVidia
control panel used this method last time I tried it.



More information about the xorg-devel mailing list