Xorg Input hotplugging and me…

Okay, whilst attempting to shirk my responsibilites (read fix pam_console’s root.audio issue (I hate sed… not so much as I hate it, as it hates me and refuses to EVER work for me properly until I have struggled with it for about 3 days) πŸ˜‰ ) I saw a Planet post from Daniel Stone, about *gasp* input hotplugging in Xorg. And I thought to myself, OMG MUST HAVE NOW. So, being as I idle in #gentoo-desktop on freenode (well, not always idle, but for the most part I do) I popped open the channel, and fired off a message to Donnie and Josh, to ask them about it. Turns out, Josh (or maybe it was Donnie) had added the snapshot to Portage already (that would be xorg-server- and so being the adventurous person that I am (and never really minding a broken box) I immediately unmasked it… and fail. It didn’t want to build because of a missing $(DBUS_LIBS) (since fixed) and, then Josh mentioned to me that I will want to update my device drivers as well, to the latest – which I did, luckily, I don’t use too many, xf86-input-{keyboard,mouse,evdev}

This is where the magic starts to happen… Okay, so finally have xorg-server- installed, xf86-input-keyboard-1.2.0 installed, and the evdev and mouse… and so I fire off startx (because you know, want to make sure it even works…) and fail. With a dbus error! Oh noes! What am I to do… well, lets see, its a dbus error, restart dbus? Nah, that wouldn’t fix it, I am using the new and improved dbus, no need to restart when new configs show up… Oh, I know – does it even HAVE a config… I seem to recall the planet post mentioning something about the policy not being set in stone…. so I look in /etc/dbus-1/system.d and nope! Hrm, ok, so, is there even a config file?

Pop into ~/sandbox (which is where I store everything I want to play with πŸ˜‰ (hat tip Compnerd)) and extract the xorg-server tarball to look around at the files… Success! There it is – xorg-server.conf. Pop into irc again and mention it to Josh, who promptly (or not promptly, im really not sure as I am playing with a new toy weeeeeeeeeeee!) fixes it to install. And, then I issue startx as for me, I am not gonna recompile xorg-server just to copy over a .conf file – and… SUCCESS! Woohoo… Okay, so X is working again, there is my wonderful Gnome desktop looking back at me, saying, please come play with me! And I apologize to it, and say, well, I am sorry, but I must get the input hot plugging working first…

Okay, back to the drawing board… There really isn’t much info on this aside from some posts on the mailing list and the planet posts (which, have mysteriously disappeared from my cache 😦 ) so… Google it is – aha! I need something called respeclaration… Okay, time to search it out – being as Mr. Daniel Stone is on fdo, I check there first – yep, its a git repo… great… I suck at using git… Every attempt to check it out gives me an EOF, which I have no idea what it means, aside from the fact that its NOT ON MY SYSTEM. No problem, I can just download the repo manually (yes, I will do things the hard way when I don’t want to take the time to learn yet) it is only 2 files, and really, I just recreate the Makefile manually, and download the respeclaration.c file. Pop those into the sandbox, and make… success! Woohoo… ok, so, now lets see, input hotplugging…

Okay, we open up the xorg.conf file, and…

*thinks – well, lets see what happens…*

*comments out all the input device infos*


FAIL. Hmm, okay, lets try running respeclaration – oh wait, something about the dbus policy and requiring root in order to add devices – so, lets restart respeclaration as root…

sudo respeclaration –daemon 0.0 (according to the –help its –daemon displaynum)



Okay… *loads up xorg.conf to verify that all input devices are in fact disabled in there* Yep… *unplugs usb mouse* *moves the usb mouse after unplugging it because sometimes when working on things I get absent minded and do the extremely obvious to make sure* Yep… *plugs the usb mouse back in and moves it… OMG MY CURSOR IS MOVING <3*

Okay, hmmm, plugs in a usb keyboard… SEGFAULT.

Okay, so input hotplugging isn’t quite ready for primetime (this is xorg 7.3 stuff we are talking about here anyways, 7.2 hasn’t even been released) – but, I want to be one of those people who really makes sure it works, because it has been something I have wanted in X for a very very long time (come on, windows has been able to do this for AGES)

Okay, so, I wanted to be really really sure, I was really doing things right, and I hopped into the xorg development channel to thank daniels, as well as verify that what I was doing was correct…. More info coming soon…


4 Responses to Xorg Input hotplugging and me…

  1. Thanks a lot for your testing and bug-finding!

    BTW, it was all Josh on this.

  2. Seems to be an arse about face way of doing it – FreeBSD has been doing at the OS level for ages. They have a moused process per mouse (devd + gentoo supports launching on hotplug) and they all multiplex through /dev/sysmouse. The beauty of this is that applications like X just need to know about the one mouse πŸ™‚

    Handy for my USB mouse on my laptop

  3. Schmots says:

    Hey Steev, long time..

  4. gergely says:


    on linux /dev/input/mice also exists, but lets suppose u have a trackpoint (as I do) and you have emulatewheel set for its middel button. now you plug in annother mounse, that has a wheel, but only 1 mouse exists in xorg.conf, one that has emulation on, so the whole thing just sucks now. I have set p my yorg.conf to solve this problem, with ading annother mouse, ent ec., but that has to be presnt at X startup. Now, this will (hoefully) solve this problem.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: