- create the rule:
$ sudo nano /etc/udev/rules.d/99-persistent-usb-serial.rules
# write/append following line:
ATTRS{idVendor}=="0457", ATTRS{idProduct}=="0819", ATTRS{busnum}=="1", ATTRS{devnum}=="2", SYMLINK+="touchscreen1", MODE="0666", OWNER=":YOUR_USER"
- get the variabled as follow:
# idVendor, idProduct, busnum, devnum:
$ lsusb
# output - bus (busnum), device (devnm), (idVendor:idProduct) :
...
Bus 001 Device 002: ID 0457:0819 Silicon Integrated Systems Corp. SiS HID Touch Controller # <--- 0457:0819
...
- change permissions for your rule
$ sudo chmod 644 /etc/udev/rules.d/99-persistent-usb-serial.rules
- reload the udev rules without reboot:
$ sudo udevadm control --reload-rules && sudo udevadm trigger
- check if everything is working:
$ ls -lF /dev
# output:
...
lrwxrwxrwx 1 root root 12 Dec 29 04:48 touchscreen1 -> input/event5 <---- this is the affected event
...
- get more info about your device:
$ udevadm info -a /dev/touchscreen1
# output:
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:14.0/usb1/1-4/1-4:1.0/0003:0457:0819.0001/input/input15/event5':
KERNEL=="event5"
SUBSYSTEM=="input"
DRIVER==""
...........................
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/0003:0457:0819.0001/input/input15':
KERNELS=="input15"
SUBSYSTEMS=="input"
DRIVERS==""
......................
ATTRS{id/bustype}=="0003"
ATTRS{id/product}=="0819"
ATTRS{id/vendor}=="0457"
ATTRS{id/version}=="0111"
ATTRS{inhibited}=="0"
ATTRS{name}=="Silicon Integrated System Co. SiS HID Touch Controller"
ATTRS{phys}=="usb-0000:00:14.0-4/input0"
ATTRS{power/async}=="disabled"
ATTRS{power/control}=="auto"
ATTRS{power/runtime_active_kids}=="0"
......................
you can achieve the same by doing:
$ udevadm info -a /dev/input/event5
# or:
$ udevadm info -a /dev/input/by-id/usb-Silicon_Integrated_System_Co._SiS_HID_Touch_Controller-mouse
# or
$ cat /proc/bus/input/device
you can know the event or name of your device by doing:
$ sudo libinput.list-devices # you need libinput-tools so `sudo apt install libinput-tools`
# output:
Device: Silicon Integrated System Co. SiS HID Touch Controller
Kernel: /dev/input/event5
Group: 6
Seat: seat0, default
Size: 341x195mm
Capabilities: touch
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: identity matrix
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a
- you can check your devices by doing:
# multitouch devices
$ ls -l /sys/bus/hid/drivers/hid-multitouch/
# output:
rminguet@rminguet-ubuntu-nbook:~$ ls /sys/bus/hid/drivers/hid-multitouch/ -l
total 0
lrwxrwxrwx 1 root root 0 Dec 29 03:58 0003:0457:0819.0001 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/0003:0457:0819.0001
lrwxrwxrwx 1 root root 0 Dec 29 03:58 0003:0457:0819.0002 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.0/0003:0457:0819.0002
--w------- 1 root root 4096 Dec 29 03:58 bind
lrwxrwxrwx 1 root root 0 Dec 29 03:58 module -> ../../../../module/hid_multitouch
--w------- 1 root root 4096 Dec 29 03:58 new_id
--w------- 1 root root 4096 Dec 29 03:58 uevent
--w------- 1 root root 4096 Dec 29 03:58 unbind
# as you could see 0003:0457:0819.0001 is here aswell