Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ACTION=="add", SUBSYSTEM=="input", RUN+="/usr/local/bin/touchpadtoggle.sh"
- ACTION=="remove", SUBSYSTEM=="input", RUN+="/usr/local/bin/touchpadtoggle.sh"
- #!/bin/bash
- notify-send "Test"
- #!/bin/bash
- sudo -u $USER DISPLAY=:0 notify-send "Test"
- sudo udevadm control -R
- $ lsusb
- $ udevadm monitor --property
- $ lsusb
- Bus 002 Device 004: ID 192f:0916 Avago Technologies, Pte.
- $ udevadm monitor --property
- [.......]
- UDEV [25696.403834] add /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22/event4 (input)
- ACTION=add
- DEVLINKS=/dev/input/by-id/usb-192f_USB_Optical_Mouse-event-mouse /dev/input/by-path/pci-0000:00:1d.7-usb-0:3.4:1.0-event-mouse
- DEVNAME=/dev/input/event4
- DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22/event4
- ID_BUS=usb
- ID_INPUT=1
- ID_INPUT_MOUSE=1
- ID_MODEL=USB_Optical_Mouse
- ID_MODEL_ENC=USBx20Opticalx20Mouse
- ID_MODEL_ID=0916
- ID_PATH=pci-0000:00:1d.7-usb-0:3.4:1.0
- ID_PATH_TAG=pci-0000_00_1d_7-usb-0_3_4_1_0
- ID_REVISION=0200
- ID_SERIAL=192f_USB_Optical_Mouse
- ID_TYPE=hid
- ID_USB_DRIVER=usbhid
- ID_USB_INTERFACES=:030102:
- ID_USB_INTERFACE_NUM=00
- ID_VENDOR=192f
- ID_VENDOR_ENC=192f
- ID_VENDOR_ID=192f
- MAJOR=13
- MINOR=68
- SEQNUM=2567
- SUBSYSTEM=input
- USEC_INITIALIZED=5875811
- UDEV [25696.407470] add /devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22/mouse0 (input)
- ACTION=add
- DEVLINKS=/dev/input/by-id/usb-192f_USB_Optical_Mouse-mouse /dev/input/by-path/pci-0000:00:1d.7-usb-0:3.4:1.0-mouse
- DEVNAME=/dev/input/mouse0
- *^^^ that's my device name ! ^^^*
- DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22/mouse0
- *^^^ that's my device path ! ^^^*
- ID_BUS=usb
- ID_INPUT=1
- ID_INPUT_MOUSE=1
- ID_MODEL=USB_Optical_Mouse
- ID_MODEL_ENC=USBx20Opticalx20Mouse
- ID_MODEL_ID=0916
- ^^^^^^^^^^^^^^^^
- ID_PATH=pci-0000:00:1d.7-usb-0:3.4:1.0
- ID_PATH_TAG=pci-0000_00_1d_7-usb-0_3_4_1_0
- ID_REVISION=0200
- ID_SERIAL=192f_USB_Optical_Mouse
- ID_TYPE=hid
- ID_USB_DRIVER=usbhid
- ID_USB_INTERFACES=:030102:
- ID_USB_INTERFACE_NUM=00
- ID_VENDOR=192f
- ID_VENDOR_ENC=192f
- ID_VENDOR_ID=192f
- ^^^^^^^^^^^^^^^^^
- MAJOR=13
- MINOR=32
- SEQNUM=2566
- SUBSYSTEM=input
- USEC_INITIALIZED=5875565
- $ udevadm info -a -p $(udevadm info -q path -n /dev/input/mouse0)
- ^^^^^^^
- may be different for you
- 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.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22/mouse0':
- KERNEL=="mouse0"
- SUBSYSTEM=="input"
- DRIVER==""
- looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003/input/input22':
- KERNELS=="input22"
- SUBSYSTEMS=="input"
- DRIVERS==""
- ATTRS{name}=="USB Optical Mouse"
- ATTRS{phys}=="usb-0000:00:1d.7-3.4/input0"
- ATTRS{uniq}==""
- ATTRS{properties}=="0"
- looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0/0003:192F:0916.0003':
- KERNELS=="0003:192F:0916.0003"
- SUBSYSTEMS=="hid"
- DRIVERS=="hid-generic"
- looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4/2-3.4:1.0':
- KERNELS=="2-3.4:1.0"
- SUBSYSTEMS=="usb"
- DRIVERS=="usbhid"
- ATTRS{bInterfaceClass}=="03"
- ATTRS{bInterfaceSubClass}=="01"
- ATTRS{bInterfaceProtocol}=="02"
- ATTRS{bNumEndpoints}=="01"
- ATTRS{supports_autosuspend}=="1"
- ATTRS{bAlternateSetting}==" 0"
- ATTRS{bInterfaceNumber}=="00"
- looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb2/2-3/2-3.4':
- KERNELS=="2-3.4"
- SUBSYSTEMS=="usb"
- DRIVERS=="usb"
- ATTRS{bDeviceSubClass}=="00"
- ATTRS{bDeviceProtocol}=="00"
- ATTRS{devpath}=="3.4"
- ATTRS{idVendor}=="192f"
- ATTRS{speed}=="1.5"
- ATTRS{bNumInterfaces}==" 1"
- ATTRS{bConfigurationValue}=="1"
- ATTRS{bMaxPacketSize0}=="8"
- ATTRS{busnum}=="2"
- ATTRS{devnum}=="8"
- ATTRS{configuration}==""
- ATTRS{bMaxPower}=="98mA"
- ATTRS{authorized}=="1"
- ATTRS{bmAttributes}=="a0"
- ATTRS{bNumConfigurations}=="1"
- ATTRS{maxchild}=="0"
- ATTRS{bcdDevice}=="0200"
- ATTRS{avoid_reset_quirk}=="0"
- ATTRS{quirks}=="0x0"
- ATTRS{version}==" 2.00"
- ATTRS{urbnum}=="62095"
- ATTRS{ltm_capable}=="no"
- ATTRS{removable}=="unknown"
- ATTRS{idProduct}=="0916"
- ATTRS{bDeviceClass}=="00"
- ATTRS{product}=="USB Optical Mouse"
- ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idVendor}=="192f",ATTRS{idProduct}=="0916",RUN+="/usr/local/bin/touchpadtoggle.sh"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement