You are not logged in.

#1 2010-06-24 21:12:31

Natanji
Member
Registered: 2009-09-22
Posts: 133

Xorg 1.8 - How does udev replace HAL?

Okay guys, I've understood that you can run custom commands to e.g. automount USB sticks or symlink devices with udev. That's pretty easy, and actually a lot less work than with the XML-style .fdi files of HAL. Good riddance I guess.

But HAL played an important role in enabling zero-configuration input devices so far. This seems no longer be working at all. With simple commands, HAL was able to dynamically add devices to X. I'm desperately trying to figure out a way to do the same with udev though, and I really can't find anything on it...

I just want to enable my Wacom tablet *without* the use of an Xorg.conf (which AFAIK is deprecated), like it was possible with HAL. I know how to match my device, but not what I need to do with udev to add those input devices to the X session. Could anyone please fill me in?

Offline

#2 2010-06-24 21:36:57

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: Xorg 1.8 - How does udev replace HAL?

xorg.conf was never deprecated.

now you got /etc/X11/xorg.conf.d/
where you can add your custom .conf files equivalent to what the fdi files used to do.

the .conf files use the same syntax xorg.conf uses. for more options, you should read man xorg.conf

Offline

#3 2010-06-24 21:43:00

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Xorg 1.8 - How does udev replace HAL?

Okay, so what rule do udev rules play in this? Does X use it in the "MatchSomething" options in xorg.conf.d files? Are those files parsed whenever a device gets hotplugged or something?

Offline

#4 2010-06-24 21:50:21

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: Xorg 1.8 - How does udev replace HAL?

Natanji wrote:

Okay, so what rule do udev rules play in this? Does X use it in the "MatchSomething" options in xorg.conf.d files? Are those files parsed whenever a device gets hotplugged or something?

hmm udev is the plug between the kernel and userspace. X find out what was added thanks to udev. check udevadm for more info. about how to configure your hardware, ive got no idea. but the info is there somewhere wink

Offline

#5 2010-06-24 22:55:20

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Xorg 1.8 - How does udev replace HAL?

If you want help with the wacom tablet, just keep one thread:

http://bbs.archlinux.org/viewtopic.php?id=99674

Last edited by anonymous_user (2010-06-24 22:56:02)

Offline

#6 2010-06-24 23:29:29

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Xorg 1.8 - How does udev replace HAL?

This was meant as a general question thread on udev and HAL, as I still don't completely get how input hotplugging is supposed to work in Xorg 1.8 without HAL.

For instance, it seems like there are multiple approaches to get input devices working if they don't work out of the box.
1. Static xorg.conf. From what I understood, this is not really favorable, and hotplugging is rather problematic (e.g. because of switching USB ports)
2. xorg.conf.d files to define the InputClass. I think the file that are there though might be updated by certain packages, so editing the files that are there is not a good idea probably. Making an own file for local changes also isn't however, since then this might create conflicts when at a later point the device is added to work out of the box via packaged rules.
3. udev rules. Seemingly the idea behind this is that you can look at the info of the device, and then via ENV variables define an environment that the xorg.conf.d InputClass files match to the correct device. This has the disadvantage, again, that these files might change and the udev rules might therefore become invalid again. Just to use my Wacom tablet as an example here, xf86-input-wacom adds 50-wacom.conf to /etc/X11/xorg.conf.d/ with a few rules (that don't match *my* tablet sadly and need to be edited), but the current version on sourceforge already uses completely different matches (e.g. to the device paths).

So right now I have no clue where input devices are actually *supposed* to be configured. Any help on what the ideas between these approaches are, and which is the most favorable and why? I wanna do this the Arch way and not clutter my system with workaround over workarounds...

Offline

#7 2010-06-25 02:28:37

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Xorg 1.8 - How does udev replace HAL?

xorg.conf.d should only be used for "defaults". It is always recommended to have your custom settings in the xorg.conf. If you put things in xorg.conf.d, they will get overwritten the next time xorg is upgraded. xorg.conf however, stays the same.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2010-06-25 02:44:08

Ben9250
Member
From: Bath - England
Registered: 2010-06-10
Posts: 208
Website

Re: Xorg 1.8 - How does udev replace HAL?

I've kept most of my settings the same, because hal is still needed by some things, like networkmanager is on example I think. The only practical alteration I've noticed is that I configred my keyboard layout in a file in xorg.conf.d as opposed to with an .fdi or xorg.conf as I did when I first started playing with Arch.


"In England we have come to rely upon a comfortable time-lag of fifty years or a century intervening between the perception that something ought to be done and a serious attempt to do it."
  - H. G. Wells

Offline

#9 2010-06-25 05:52:22

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Xorg 1.8 - How does udev replace HAL?

Inxsible wrote:

xorg.conf.d should only be used for "defaults". It is always recommended to have your custom settings in the xorg.conf. If you put things in xorg.conf.d, they will get overwritten the next time xorg is upgraded. xorg.conf however, stays the same.

How to manage a dynamic config then that works with hotplugging? E.g. let's say I have an external USB input device that should get assigned the proper driver when I connect it. If I plu it into a different USB port they static config will not work; I need udev to match the device to some common thing, right? Or is this solved by symlinking that device to the same spot in /dev/input/ then?

Offline

#10 2010-06-25 06:41:18

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Xorg 1.8 - How does udev replace HAL?

The big news with the previous Xorg was "ZOMG ABILITY TO RUN WITHOUT XORG.CONF"
Look at it now....


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#11 2010-06-25 06:58:23

lustikus
Member
Registered: 2009-11-10
Posts: 262

Re: Xorg 1.8 - How does udev replace HAL?

Natanji wrote:
Inxsible wrote:

xorg.conf.d should only be used for "defaults". It is always recommended to have your custom settings in the xorg.conf. If you put things in xorg.conf.d, they will get overwritten the next time xorg is upgraded. xorg.conf however, stays the same.

How to manage a dynamic config then that works with hotplugging? E.g. let's say I have an external USB input device that should get assigned the proper driver when I connect it. If I plu it into a different USB port they static config will not work; I need udev to match the device to some common thing, right? Or is this solved by symlinking that device to the same spot in /dev/input/ then?

usb automounting can be done with udev rules:  http://wiki.archlinux.org/index.php/Ude … SB_devices

Offline

#12 2010-06-25 08:52:24

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Xorg 1.8 - How does udev replace HAL?

moljac024 wrote:

The big news with the previous Xorg was "ZOMG ABILITY TO RUN WITHOUT XORG.CONF"
Look at it now....

It still runs without an xorg.conf. It's only when you want to deviate from the defaults that you need one. This makes full sense, because you gotta put your personal configuration somewhere. And why not in a file many are already familiar with?

Natanji wrote:

How to manage a dynamic config then that works with hotplugging? E.g. let's say I have an external USB input device that should get assigned the proper driver when I connect it. If I plu it into a different USB port they static config will not work; I need udev to match the device to some common thing, right? Or is this solved by symlinking that device to the same spot in /dev/input/ then?

No, you don't mess with udev rules. You create InputClass sections in xorg.conf that contain match rules. Typical examples are MatchIsKeyboard (settings in this section will apply to every keyboard) and MatchIsTouchpad (settings in this section will apply to every touchpad), but there are more, you can match by vendor for example.

Offline

#13 2010-06-25 09:59:03

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: Xorg 1.8 - How does udev replace HAL?

Inxsible wrote:

xorg.conf.d should only be used for "defaults". It is always recommended to have your custom settings in the xorg.conf. If you put things in xorg.conf.d, they will get overwritten the next time xorg is upgraded. xorg.conf however, stays the same.

Wait, this means I will need to create a new "keyboard.conf" file on every update? Since that file wasn't there as "default"...
Should I just copy the following lines into "10-synaptics.conf"?

Identifier             "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option                 "XkbLayout" "hr"
    Option           "XkbOptions" "terminate:ctrl_alt_bksp"

The above is under "Section "InputClass"" in /etc/X11/xorg.conf.d/keyboard.conf

Last edited by archman-cro (2010-06-25 10:02:20)

Offline

#14 2010-06-25 10:20:19

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Xorg 1.8 - How does udev replace HAL?

lustikus wrote:

usb automounting can be done with udev rules:  http://wiki.archlinux.org/index.php/Ude … SB_devices

I know, that's not the point. My problem is specifically with *input* devices.

@archman-cro: You understood it wrong. The files that are already in /etc/X11/xorg.conf.d/ will get overwirrten with every update. These are files that typicall get managed by different packages. Basically, if you add a synaptics touchpad driver, that package will but its 10-synaptics.conf in there. If you use a wacom tablet (xf-86-input-wacom package), a 50-wacom.conf will get put there. These files should NOT be modified because if the package gets updated or reinstalled, the old one will be removed.

What you could do is maybe create a file that no package will ever overwrite in there, like /etc/X11/xorg.conf.d/10-local-rules.conf. Then put any local rules in there and hope no package ever wants to use 10-local-rules.conf. wink This also has the advantage that these rules are parsed before most of the other rules, as all etc/X11/xorg.conf.d/*.conf files are parsed in alphabetical order.

I've got a question on the InputClass section. You can use MatchProduct and Matchvendor there. But how do you find out for a given device what the value of the Product and Vendor strings are? I know you can do this for USB devices with the lsusb command, but how about serial devices?

Last edited by Natanji (2010-06-25 10:21:34)

Offline

#15 2010-06-25 11:13:17

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: Xorg 1.8 - How does udev replace HAL?

Natanji: Thanks for clarifying. smile I'll just wait for the next update and see what exactly changes, so I understand it better. I've edited 10-synaptics.conf file by changing (or adding, I don't remember) the line for sidescrolling. This will, then, probably get "erased". So I'll wait and see. That's how I learn. big_smile
Cheers. smile

*Update*: made a "custom.conf" file inside "xorg.conf.d" and migrated those lines I had in synaptics.conf to it and it works. smile That's it, probably, I guess the "custom.conf" won't get overwritten. big_smile

Last edited by archman-cro (2010-06-25 11:32:00)

Offline

#16 2010-06-25 14:36:25

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Xorg 1.8 - How does udev replace HAL?

archman-cro wrote:
Inxsible wrote:

xorg.conf.d should only be used for "defaults". It is always recommended to have your custom settings in the xorg.conf. If you put things in xorg.conf.d, they will get overwritten the next time xorg is upgraded. xorg.conf however, stays the same.

Wait, this means I will need to create a new "keyboard.conf" file on every update? Since that file wasn't there as "default"...
Should I just copy the following lines into "10-synaptics.conf"?

Identifier             "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option                 "XkbLayout" "hr"
    Option           "XkbOptions" "terminate:ctrl_alt_bksp"

The above is under "Section "InputClass"" in /etc/X11/xorg.conf.d/keyboard.conf

Yes, that's why I have my dual monitor set up in my xorg.conf. As of right now there is nothing else in my xorg.conf, but if I need any other "custom" setting, I sure as hell am gonna put it in xorg.conf


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB