You are not logged in.

#1 2010-09-17 12:11:02

xelados
Member
Registered: 2007-06-02
Posts: 314
Website

[SOLVED] Getting consistent mouse sensitivity with udev

I've noticed recently that every time I disconnect my mouse from a USB port on my box, my `xset m 4 3` setting in ~/.xinitrc is wiped out, so when I plug it back in, the sensitivity is reset. So I consulted udev, and have tried a wide variety of rules found at various sources, from Ubuntu forums to the Gentoo and Arch wiki to the forums here, and nothing has worked. All I need to do is match the device and run `xset -display :0.0 m 4 3`; a simple task that I think has me stumped because I'm missing something obvious. I'd love it if someone could help me figure this rule out.

Here's the rule I currently have, which doesn't work:

KERNEL=="input/mouse*", SUBSYSTEMS=="input", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB-PS/2 Optical Mouse", RUN+="/usr/bin/xset -display :0.0 m 4 3"


Here's output from `udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse0)`:

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.3/usb4/4-2/4-2:1.0/input/input39/mouse0':
    KERNEL=="mouse0"
    SUBSYSTEM=="input"
    DRIVER==""

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

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb4/4-2/4-2:1.0':
    KERNELS=="4-2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{modalias}=="usb:v046DpC00Ed1110dc00dsc00dp00ic03isc01ip02"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb4/4-2':
    KERNELS=="4-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bMaxPower}==" 98mA"
    ATTRS{urbnum}=="4150"
    ATTRS{idVendor}=="046d"
    ATTRS{idProduct}=="c00e"
    ATTRS{bcdDevice}=="1110"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="1.5"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="35"
    ATTRS{devpath}=="2"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Logitech"
    ATTRS{product}=="USB-PS/2 Optical Mouse"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3/usb4':
    KERNELS=="usb4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="717"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="2"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.35-ARCH uhci_hcd"
    ATTRS{product}=="UHCI Host Controller"
    ATTRS{serial}=="0000:00:1d.3"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1d.3':
    KERNELS=="0000:00:1d.3"
    SUBSYSTEMS=="pci"
    DRIVERS=="uhci_hcd"
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x27cb"
    ATTRS{subsystem_vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x464c"
    ATTRS{class}=="0x0c0300"
    ATTRS{irq}=="16"
    ATTRS{local_cpus}=="ff"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{modalias}=="pci:v00008086d000027CBsv00008086sd0000464Cbc0Csc03i00"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

My thanks go out to anyone who's willing to help.

Solution:

KERNEL=="mouse*", SUBSYSTEM=="input", ATTRS{manufacturer}=="Logitech", ATTRS{product}=="USB-PS/2 Optical Mouse", RUN+="/usr/bin/xset -display :0.0 m 4 3"

Last edited by xelados (2010-09-17 12:22:07)

Offline

#2 2010-09-17 12:20:24

xelados
Member
Registered: 2007-06-02
Posts: 314
Website

Re: [SOLVED] Getting consistent mouse sensitivity with udev

Boy, silly me.

All I did was remove "input/" from the KERNEL option and make SUBSYSTEMS singular, and it worked!

Offline

Board footer

Powered by FluxBB