
 Disable/enable touchpad when usb mouse is connected
-----------------------------------------------------


- Bash script goes into your /home/<user>/bin folder. Don't forget to give it execution rights.
  Change the TOUCHPAD_ID to the ID/number of your touchpad. Run 'xinput list' to check which ID.

- Udev rule goes into /etc/udev/rules.d folder and must be chowned to root.
  Change the path behind the RUN command to the path of your home/bin folder. (where the bash script is)
  Change the vendor-id (XXXX) and product-id (YYYY) to that of your usb mouse.
  To get the vendor-id and product-id plug of your usb mouse, run 'lsusb'.

  For example, you get this:
  "Bus 001 Device 016: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse"
                          ^^^^^^^^^
  These are the vendor-id:product-id of your usb mouse.
  Change XXXX to the vendor-id and YYYY to product-id in the udev rule on both lines.

- Now we need to update the udev rules and restart udev service. Run the following commands:

   udevadm control --reload-rules
   udevadm trigger
   sudo systemctl restart udev


When all went correct
If you plug your usb-mouse, the touchpad gets disabled.
If you unplug the usb mouse the touchpad gets enabled.
If not, see the $HOME/bin/usb-mouse-connect.log for errors.



Good luck!
Koentje  (remon@cobrasoft.nl)