Skip to content

from xinput name tot sysfs name

tias edited this page Sep 13, 2010 · 1 revision

To save the config either as udev rule, hal fdi file or even xorg.conf, we need the sysfs name of the device.

When the driver is evdev this is easy: it is the same as the xinput name.
TODO: is it possible to set another name using Identifier “X” in xorg.conf ?

  • Using udev
    lshal is not even installed on my laptop anymore, so best focus on udev.
    Devices can be queried using ‘udevadm info’, but first you need to figure out the name of the device….
    TODO: how to figure out the udev name ?

$ /sbin/udevadm info —name=input/event4 —attribute-walk

looking at parent device ‘/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input4’:
KERNELS"input4" SUBSYSTEMS“input”
DRIVERS"" ATTRS{name}“Logitech USB-PS/2 Optical Mouse”
ATTRS{phys}"usb-0000:00:1d.1-1/input0" ATTRS{uniq}""
ATTRS{modalias}==“input:b0003v046DpC00Ee0110-e0,1,2,4,k110,111,112,r0,1,8,am4,lsfw”

The ‘ATTRS{name}’ is what we want to use.
TODO: Now we just need to find out the udev name/device path…

  • Using lshal
    lshal lists devices, and gives for example:

    info.product = ‘Logitech USB-PS/2 Optical Mouse’ (string)
    info.subsystem = ‘input’ (string)
    info.udi = ‘/org/freedesktop/Hal/devices/usb_device_46d_c00e_noserial_if0_logicaldev_input’ (string)
    input.device = ‘/dev/input/event4’ (string)
    input.originating_device = ‘/org/freedesktop/Hal/devices/usb_device_46d_c00e_noserial_if0’ (string)
    input.product = ‘Logitech USB-PS/2 Optical Mouse’ (string)
    input.×11driver = ‘evdev’ (string)
    linux.device_file = ‘/dev/input/event4’ (string)
    linux.hotplug
    type = 2 (0×2) (int)
    linux.subsystem = ‘input’ (string)

The info.product name is the sysfs name.
TODO: is the input.product name is the xinput name, or simply a copy of the sysfs name ?

Clone this wiki locally