Announcement

Collapse
No announcement yet.

Disable Input from USB Device

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Disable Input from USB Device

    I have an Avantree USB Bluetooth adapter that the adapter its self pairs with the Bluetooth headset. I have found that this adapter can also send keystrokes for the use of changing the volume on the system. I would prefer to disable the keyboard input from this device permanently.

    I have found that if I use the command "xinput -list", I can easily find the device ID. The device shows up with 2 device ID's one under "Virtual Core Pointer" and another under "Virtual Core Keyboard". Disabling the device ID under Virtual Core Keyboard does not stop the input from this device, but if I disable the "Virtual Core Pointer" the device behaves as expected.

    With that I can then use the command "xinput disable ##" and it disables the keyboard input and the headset no-longer controls the system volume as I want.

    The problem is that this device being USB has no garauntee of coming back as the same "Device ID", so I can't just create a simple script to do this.

    I think I need to create a custom .conf file for this device so that when it is plugged in the keyboard functionality of this device will not be enabled. It looks like those are stored in /usr/share/X11/xorg.conf.d/ .

    Can someone point me to a guide or provide me instructions that will walk me through how to create one of those .conf files for this device so I can get it to behave?

    #2
    Sounds like a fun project. You should post more details tho, like the device ID. Not the USB bus/device id numbers - the 8 digit hex number is lsusb - looks like 1234:5678.

    A couple of thoughts: if you end up using xorg, the place to put the file is /etc/X11/xorg.conf.d not /usr/share/ because an update could wipe the /usr/share directory but won't the /etc one.

    Once you have your device ID, look into udev rules. There might be a way to amend the behavior using a udev rule.

    You could also write a script that would detect the xinput device number at log in and then send the disable command - that might be the easiest.

    Please Read Me

    Comment


      #3
      Post the output of xinput --list too

      Please Read Me

      Comment


        #4
        Here's something: xinput will list the device number only with this command format:

        xinput --list --id-only 'pointer:<YOUR DEVICE LABEL HERE>'

        This will output only the device number of the pointer device. So then you need only add this to the other command:

        xinput disable `xinput --list --id-only 'pointer:<YOUR DEVICE LABEL HERE>'`

        I tested this on my system and it worked (turned my mouse off). Adding this to ~/.profile should do it.
        Last edited by oshunluvr; Sep 14, 2016, 05:13 PM.

        Please Read Me

        Comment


          #5
          Code:
          [FONT=monospace]atomic@atom-88:~$ xinput --list   
          ⎡ Virtual core pointer                          id=2    [master pointer  (3)]
          ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
          ⎜   ↳ Logitech Anywhere MX                      id=9    [slave  pointer  (2)]
          ⎜   ↳ PS/2 Generic Mouse                        id=11   [slave  pointer  (2)]
          ⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
          ⎜   ↳ Avantree Leaf                             id=16   [slave  pointer  (2)]
          ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
              ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
              ↳ Power Button                              id=6    [slave  keyboard (3)]
              ↳ Video Bus                                 id=7    [slave  keyboard (3)]
              ↳ Sleep Button                              id=8    [slave  keyboard (3)]
              ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
              ↳ HP Wireless hotkeys                       id=13   [slave  keyboard (3)]
              ↳ HP WMI hotkeys                            id=14   [slave  keyboard (3)]
              ↳ Avantree Leaf                             id=15   [slave  keyboard (3)]
          
          [/FONT]
          *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

          Code:
          [FONT=monospace]atomic@atom-88:~$ lsusb
          Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
          Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
          Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
          Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
          Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
          Bus 003 Device 004: ID 0a12:1004 Cambridge Silicon Radio, Ltd  
          Bus 003 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
          Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
          
          [/FONT]
          These are the USB Audio Adapter.

          ⎡ Virtual core pointer id=2 [master pointer (3)]
          Avantree Leaf id=16 [slave pointer (2)]

          Bus 003 Device 004: ID 0a12:1004 Cambridge Silicon Radio, Ltd

          Comment


            #6
            This command should work to disable only the pointer functions:

            xinput disable `xinput --list --id-only 'pointer:Avantree Leaf'`


            This will disable the keyboard functions:

            xinput disable `xinput --list --id-only 'keyboard:Avantree Leaf'`

            Add either or both to ~/.profile and you should be good to go.

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              This command should work to disable only the pointer functions:

              xinput disable `xinput --list --id-only 'pointer:Avantree Leaf'`


              This will disable the keyboard functions:

              xinput disable `xinput --list --id-only 'keyboard:Avantree Leaf'`

              Add either or both to ~/.profile and you should be good to go.

              If I add it to ~/.profile will it work it the device is hot plugged while I am logged in? or is this something that only executes at logon or startup?

              Comment


                #8
                No, not for hot plugging. You'd have to run it manually or with a udev rule.

                Please Read Me

                Comment


                  #9
                  http://unix.stackexchange.com/questi...device-plug-in

                  Please Read Me

                  Comment


                    #10
                    udev rules go in /etc/udev/rules.d/ and would look something like:

                    ACTION=="add", ATTRS{idVendor}=="0a12", ATTRS{idProduct}=="1004", RUN+="/home/<YOUR USERNAME>/.local/<YOURSCRIPT>"

                    The script would only need the shebang and the above xinput command. I suggest putting the script in your home under .local

                    Please Read Me

                    Comment


                      #11
                      OK, I'm stuck.

                      I created the following rule, but it doesn't seem to be firing as expected.

                      /etc/udev/rules.d/99-Avantree-Leaf.rules

                      Code:
                      SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0a12", ATTR{idProduct}=="1004", RUN+="/home/atomic/.local/Avantree-Leaf-Disable-Keyboard.sh"
                      I've also tried it like this:

                      Code:
                      SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="0a12", ATTRS{idProduct}=="1004", RUN+="/home/atomic/.local/Avantree-Leaf-Disable-Keyboard.sh"

                      My script contains the following.

                      /home/atomic/.local/Avantree-Leaf-Disable-Keyboard.sh

                      Code:
                      #!/bin/bash
                      xinput disable `xinput --list --id-only 'pointer:Avantree Leaf'`
                      If I drop this into my terminal it runs as expected, and disables the keyboard input /home/atomic/.local/Avantree-Leaf-Disable-Keyboard.sh. Based on this evidence I assume my script isn't the problem.

                      Here are some commands that I tried to run to figure out what might be causing it not to trigger, but I can't find any problems.


                      Code:
                      atomic@atom-88:~$ sudo udevadm info --attribute-walk --name /dev/input/by-id/usb-0a12_Avantree_Leaf-event-if03
                      
                      
                      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:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0019/input/input47/event17':
                          KERNEL=="event17"
                          SUBSYSTEM=="input"
                          DRIVER==""
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0019/input/input47':
                          KERNELS=="input47"
                          SUBSYSTEMS=="input"
                          DRIVERS==""
                          ATTRS{name}=="Avantree Leaf"
                          ATTRS{phys}=="usb-0000:00:1a.0-1.2/input3"
                          ATTRS{properties}=="0"
                          ATTRS{uniq}==""
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0019':
                          KERNELS=="0003:0A12:1004.0019"
                          SUBSYSTEMS=="hid"
                          DRIVERS=="hid-generic"
                          ATTRS{country}=="00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3':
                          KERNELS=="1-1.2:1.3"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usbhid"
                          ATTRS{authorized}=="1"
                          ATTRS{bAlternateSetting}==" 0"
                          ATTRS{bInterfaceClass}=="03"
                          ATTRS{bInterfaceNumber}=="03"
                          ATTRS{bInterfaceProtocol}=="00"
                          ATTRS{bInterfaceSubClass}=="00"
                          ATTRS{bNumEndpoints}=="01"
                          ATTRS{supports_autosuspend}=="1"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2':
                          KERNELS=="1-1.2"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="00"
                          ATTRS{bDeviceProtocol}=="00"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="96mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 5"
                          ATTRS{bcdDevice}=="0547"
                          ATTRS{bmAttributes}=="80"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="11"
                          ATTRS{devpath}=="1.2"
                          ATTRS{idProduct}=="1004"
                          ATTRS{idVendor}=="0a12"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{maxchild}=="0"
                          ATTRS{product}=="Avantree Leaf"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="unknown"
                          ATTRS{speed}=="12"
                          ATTRS{urbnum}=="51098"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1':
                          KERNELS=="1-1"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="09"
                          ATTRS{bDeviceProtocol}=="01"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="0mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 1"
                          ATTRS{bcdDevice}=="0000"
                          ATTRS{bmAttributes}=="e0"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="2"
                          ATTRS{devpath}=="1"
                          ATTRS{idProduct}=="0024"
                          ATTRS{idVendor}=="8087"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{maxchild}=="6"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="fixed"
                          ATTRS{speed}=="480"
                          ATTRS{urbnum}=="266"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1':
                          KERNELS=="usb1"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{authorized_default}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="09"
                          ATTRS{bDeviceProtocol}=="00"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="0mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 1"
                          ATTRS{bcdDevice}=="0404"
                          ATTRS{bmAttributes}=="e0"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="1"
                          ATTRS{devpath}=="0"
                          ATTRS{idProduct}=="0002"
                          ATTRS{idVendor}=="1d6b"
                          ATTRS{interface_authorized_default}=="1"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{manufacturer}=="Linux 4.4.0-36-generic ehci_hcd"
                          ATTRS{maxchild}=="3"
                          ATTRS{product}=="EHCI Host Controller"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="unknown"
                          ATTRS{serial}=="0000:00:1a.0"
                          ATTRS{speed}=="480"
                          ATTRS{urbnum}=="139"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0':
                          KERNELS=="0000:00:1a.0"
                          SUBSYSTEMS=="pci"
                          DRIVERS=="ehci-pci"
                          ATTRS{broken_parity_status}=="0"
                          ATTRS{class}=="0x0c0320"
                          ATTRS{companion}==""
                          ATTRS{consistent_dma_mask_bits}=="32"
                          ATTRS{d3cold_allowed}=="1"
                          ATTRS{device}=="0x1e2d"
                          ATTRS{dma_mask_bits}=="32"
                          ATTRS{driver_override}=="(null)"
                          ATTRS{enable}=="1"
                          ATTRS{irq}=="16"
                          ATTRS{local_cpulist}=="0-3"
                          ATTRS{local_cpus}=="0f"
                          ATTRS{msi_bus}=="1"
                          ATTRS{numa_node}=="-1"
                          ATTRS{subsystem_device}=="0x17df"
                          ATTRS{subsystem_vendor}=="0x103c"
                          ATTRS{uframe_periodic_max}=="100"
                          ATTRS{vendor}=="0x8086"
                      
                      
                        looking at parent device '/devices/pci0000:00':
                          KERNELS=="pci0000:00"
                          SUBSYSTEMS==""
                          DRIVERS==""
                      
                      
                      
                      
                      -----------------------------------------------------------------------------------------------------------------------
                      
                      
                      
                      
                      
                      
                      atomic@atom-88:~$ sudo udevadm info --attribute-walk --name /dev/input/by-id/usb-0a12_Avantree_Leaf-if04-event-kbd
                      
                      
                      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:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.001A/input/input48/event18':
                          KERNEL=="event18"
                          SUBSYSTEM=="input"
                          DRIVER==""
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.001A/input/input48':
                          KERNELS=="input48"
                          SUBSYSTEMS=="input"
                          DRIVERS==""
                          ATTRS{name}=="Avantree Leaf"
                          ATTRS{phys}=="usb-0000:00:1a.0-1.2/input4"
                          ATTRS{properties}=="0"
                          ATTRS{uniq}==""
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.001A':
                          KERNELS=="0003:0A12:1004.001A"
                          SUBSYSTEMS=="hid"
                          DRIVERS=="hid-generic"
                          ATTRS{country}=="00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4':
                          KERNELS=="1-1.2:1.4"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usbhid"
                          ATTRS{authorized}=="1"
                          ATTRS{bAlternateSetting}==" 0"
                          ATTRS{bInterfaceClass}=="03"
                          ATTRS{bInterfaceNumber}=="04"
                          ATTRS{bInterfaceProtocol}=="00"
                          ATTRS{bInterfaceSubClass}=="00"
                          ATTRS{bNumEndpoints}=="01"
                          ATTRS{supports_autosuspend}=="1"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2':
                          KERNELS=="1-1.2"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="00"
                          ATTRS{bDeviceProtocol}=="00"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="96mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 5"
                          ATTRS{bcdDevice}=="0547"
                          ATTRS{bmAttributes}=="80"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="11"
                          ATTRS{devpath}=="1.2"
                          ATTRS{idProduct}=="1004"
                          ATTRS{idVendor}=="0a12"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{maxchild}=="0"
                          ATTRS{product}=="Avantree Leaf"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="unknown"
                          ATTRS{speed}=="12"
                          ATTRS{urbnum}=="62170"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1':
                          KERNELS=="1-1"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="09"
                          ATTRS{bDeviceProtocol}=="01"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="0mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 1"
                          ATTRS{bcdDevice}=="0000"
                          ATTRS{bmAttributes}=="e0"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="2"
                          ATTRS{devpath}=="1"
                          ATTRS{idProduct}=="0024"
                          ATTRS{idVendor}=="8087"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{maxchild}=="6"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="fixed"
                          ATTRS{speed}=="480"
                          ATTRS{urbnum}=="266"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1':
                          KERNELS=="usb1"
                          SUBSYSTEMS=="usb"
                          DRIVERS=="usb"
                          ATTRS{authorized}=="1"
                          ATTRS{authorized_default}=="1"
                          ATTRS{avoid_reset_quirk}=="0"
                          ATTRS{bConfigurationValue}=="1"
                          ATTRS{bDeviceClass}=="09"
                          ATTRS{bDeviceProtocol}=="00"
                          ATTRS{bDeviceSubClass}=="00"
                          ATTRS{bMaxPacketSize0}=="64"
                          ATTRS{bMaxPower}=="0mA"
                          ATTRS{bNumConfigurations}=="1"
                          ATTRS{bNumInterfaces}==" 1"
                          ATTRS{bcdDevice}=="0404"
                          ATTRS{bmAttributes}=="e0"
                          ATTRS{busnum}=="1"
                          ATTRS{configuration}==""
                          ATTRS{devnum}=="1"
                          ATTRS{devpath}=="0"
                          ATTRS{idProduct}=="0002"
                          ATTRS{idVendor}=="1d6b"
                          ATTRS{interface_authorized_default}=="1"
                          ATTRS{ltm_capable}=="no"
                          ATTRS{manufacturer}=="Linux 4.4.0-36-generic ehci_hcd"
                          ATTRS{maxchild}=="3"
                          ATTRS{product}=="EHCI Host Controller"
                          ATTRS{quirks}=="0x0"
                          ATTRS{removable}=="unknown"
                          ATTRS{serial}=="0000:00:1a.0"
                          ATTRS{speed}=="480"
                          ATTRS{urbnum}=="139"
                          ATTRS{version}==" 2.00"
                      
                      
                        looking at parent device '/devices/pci0000:00/0000:00:1a.0':
                          KERNELS=="0000:00:1a.0"
                          SUBSYSTEMS=="pci"
                          DRIVERS=="ehci-pci"
                          ATTRS{broken_parity_status}=="0"
                          ATTRS{class}=="0x0c0320"
                          ATTRS{companion}==""
                          ATTRS{consistent_dma_mask_bits}=="32"
                          ATTRS{d3cold_allowed}=="1"
                          ATTRS{device}=="0x1e2d"
                          ATTRS{dma_mask_bits}=="32"
                          ATTRS{driver_override}=="(null)"
                          ATTRS{enable}=="1"
                          ATTRS{irq}=="16"
                          ATTRS{local_cpulist}=="0-3"
                          ATTRS{local_cpus}=="0f"
                          ATTRS{msi_bus}=="1"
                          ATTRS{numa_node}=="-1"
                          ATTRS{subsystem_device}=="0x17df"
                          ATTRS{subsystem_vendor}=="0x103c"
                          ATTRS{uframe_periodic_max}=="100"
                          ATTRS{vendor}=="0x8086"
                      
                      
                        looking at parent device '/devices/pci0000:00':
                          KERNELS=="pci0000:00"
                          SUBSYSTEMS==""
                          DRIVERS==""

                      And this is the udevadm monitor output when I disconnect and reconnect the device.

                      Code:
                      monitor will print the received events for:
                      UDEV - the event which udev sends out after rule processing
                      KERNEL - the kernel uevent
                      
                      
                      KERNEL[22802.808997] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0p (sound)
                      KERNEL[22802.809977] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0c (sound)
                      KERNEL[22802.810928] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/controlC1 (sound)
                      KERNEL[22802.810969] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      UDEV  [22802.814610] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0c (sound)
                      UDEV  [22802.814874] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0p (sound)
                      UDEV  [22802.822057] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/controlC1 (sound)
                      KERNEL[22802.824421] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
                      KERNEL[22802.824483] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
                      KERNEL[22802.824531] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
                      UDEV  [22802.826746] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      UDEV  [22802.827546] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
                      UDEV  [22802.829414] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
                      UDEV  [22802.833898] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
                      KERNEL[22802.840281] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/input/input41/event17 (input)
                      UDEV  [22802.843548] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/input/input41/event17 (input)
                      KERNEL[22802.864210] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/input/input41 (input)
                      KERNEL[22802.865528] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/usbmisc/hiddev1 (usbmisc)
                      KERNEL[22802.867588] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/hidraw/hidraw2 (hidraw)
                      KERNEL[22802.867647] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013 (hid)
                      KERNEL[22802.867688] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
                      UDEV  [22802.868032] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/input/input41 (input)
                      UDEV  [22802.870056] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013/hidraw/hidraw2 (hidraw)
                      UDEV  [22802.872722] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/usbmisc/hiddev1 (usbmisc)
                      UDEV  [22802.874438] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0013 (hid)
                      UDEV  [22802.877523] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
                      KERNEL[22802.912299] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/input/input42/event18 (input)
                      UDEV  [22802.914683] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/input/input42/event18 (input)
                      KERNEL[22802.928303] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/input/input42 (input)
                      KERNEL[22802.928423] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/hidraw/hidraw3 (hidraw)
                      KERNEL[22802.928524] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014 (hid)
                      KERNEL[22802.928628] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4 (usb)
                      KERNEL[22802.928770] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
                      UDEV  [22802.931385] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/input/input42 (input)
                      UDEV  [22802.931438] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014/hidraw/hidraw3 (hidraw)
                      UDEV  [22802.934631] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0014 (hid)
                      UDEV  [22802.936171] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4 (usb)
                      UDEV  [22802.945436] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
                      KERNEL[22811.075125] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
                      KERNEL[22811.076364] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
                      KERNEL[22811.124155] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      KERNEL[22811.125916] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/controlC1 (sound)
                      KERNEL[22811.125965] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0p (sound)
                      KERNEL[22811.126002] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0c (sound)
                      KERNEL[22811.126049] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
                      KERNEL[22811.126095] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
                      KERNEL[22811.126137] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
                      KERNEL[22811.127969] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015 (hid)
                      KERNEL[22811.130184] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/input/input43 (input)
                      KERNEL[22811.184257] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/input/input43/event17 (input)
                      KERNEL[22811.184420] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/usbmisc/hiddev1 (usbmisc)
                      KERNEL[22811.184558] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/hidraw/hidraw2 (hidraw)
                      KERNEL[22811.184708] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4 (usb)
                      KERNEL[22811.186719] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016 (hid)
                      KERNEL[22811.187707] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/input/input44 (input)
                      KERNEL[22811.240240] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/input/input44/event18 (input)
                      KERNEL[22811.240863] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/hidraw/hidraw3 (hidraw)
                      UDEV  [22811.255838] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)
                      UDEV  [22811.275873] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)
                      UDEV  [22811.285158] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3 (usb)
                      UDEV  [22811.291226] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)
                      UDEV  [22811.294300] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)
                      UDEV  [22811.300768] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      UDEV  [22811.300837] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4 (usb)
                      KERNEL[22811.308871] change   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      UDEV  [22811.313180] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015 (hid)
                      UDEV  [22811.325696] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/usbmisc/hiddev1 (usbmisc)
                      UDEV  [22811.326131] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0c (sound)
                      UDEV  [22811.336975] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016 (hid)
                      UDEV  [22811.341355] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/hidraw/hidraw2 (hidraw)
                      UDEV  [22811.342589] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/pcmC1D0p (sound)
                      UDEV  [22811.347815] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1/controlC1 (sound)
                      UDEV  [22811.350996] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/input/input44 (input)
                      UDEV  [22811.351210] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/input/input43 (input)
                      UDEV  [22811.356629] change   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/sound/card1 (sound)
                      UDEV  [22811.365195] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/hidraw/hidraw3 (hidraw)
                      UDEV  [22811.374233] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:0A12:1004.0015/input/input43/event17 (input)
                      UDEV  [22811.379886] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.4/0003:0A12:1004.0016/input/input44/event18 (input)

                      Comment


                        #12
                        Are you using 16.04? If so, you should be using systemd services.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Originally posted by GreyGeek View Post
                          Are you using 16.04? If so, you should be using systemd services.
                          Yes I am on 16.04, is there a guide somewhere on how to handle this through systemd services?

                          Comment


                            #14
                            I think action needs to precede subsystem in the udev rule. Also, try adding /bin/bash to the script command. So it should look like this:

                            ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", ATTRS{idProduct}=="1004", RUN+="/bin/bash /home/atomic/.local/Avantree-Leaf-Disable-Keyboard.sh"


                            Also, you need to reload the rules if you don't reboot.

                            udevadm control --reload-rules

                            Please Read Me

                            Comment


                              #15
                              To create a systemd service instead, you might read here: https://fixmynix.com/run-shell-scripts-from-udev-rules/

                              Please Read Me

                              Comment

                              Working...
                              X