Ubuntu – Mouse/touchpad toggle in Ubuntu

mouseUbuntu

How to tune Ubuntu to automatically deactivate a touchpad on mouse connect and activate on its disconnect?

Best Answer

You can manually disable an input device via:

xinput set-int-prop "B16_b_02 USB-PS/2 Optical Mouse" 'Device Enabled' 8 0

and reenable it via:

xinput set-int-prop "B16_b_02 USB-PS/2 Optical Mouse" 'Device Enabled' 8 1

You can get the list of device names via:

xinput list

If you want to automate the whole process you could write a script to listen to HAL, which will tell you when devices are plugged in or removed. As a starting point you can have a look at xboxdrv-daemon.py