1

I'm trying to run a script when my mouse connects.

#!/bin/sh

echo New mouse speed applied
id=17
speed=1
xinput set-prop $id "Coordinate Transformation Matrix" $speed, 0, 0, 0, $speed, 0, 0, 0, 1
firefox #Starting this so I'll see instantly if it worked

The udev rule:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idProduct}=="0405", ATTRS{idVendor}=="145f", RUN+="/home/matthes/.mousespeed.sh"

The script works, I tested it manually.

$ udevadm info -a -p /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1/0003:145F:0405.001A/input/input43/mouse4

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
    KERNELS=="1-3"
    SUBSYSTEMS=="usb"
    [...]
    ATTRS{idProduct}=="0405"
    ATTRS{idVendor}=="145f"
    [...]
    ATTRS{product}=="Trust Gaming Mouse"
    [...]

idProduct and idVendor are correct too, I can't figure out why it won't work. Thanks for any help!

5
  • 1
    Possibly for the same reason as here Udev not running scripts i.e. xinput can't connect to a running xserver Sep 20, 2019 at 14:50
  • @steeldriver nope, not working sadly. I think it should at least start firefox, right? Sep 20, 2019 at 14:55
  • How should it know which xserver / display to start firefox on? Sep 20, 2019 at 14:59
  • I'll take that as a no. I did it as in your link, added both exports, but that didn't help Sep 20, 2019 at 15:00
  • The correct way is to use xorg.conf, could you add prop listing of that device from xinput.
    – user.dz
    Oct 13, 2019 at 23:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.