You can do various quick configuration changes such as to enable, disable devices using Xinput via Terminal in Linux in general. Here’s how.
Xinput is a utility that gives you configuration options to control mouse, keyboard, touchpad, touch screen devices in Linux (applicable for all Linux distributions such as Ubuntu, Fedora). It is part of xorg-xinput package which provides various device services.
How to enable, disable devices using Xinput
Open up the terminal. To list out all the devices connected to your computer run below command. It will list out all devices with their device ID. This device ID is important because you have to pass it as an argument when enabling or disabling any device.
The above command should give you a list of devices with ID – something like this. You can see all the keyboards (in case you have multiple keyboards attached), touchpad, pointing devices are listed with their device ID.
You can easily figure out by name which device they represent.
For example, if I want to disable any device say the touchscreen, simply run:
xinput disable 13
This will immediately disable the touchscreen of a device (as per the above example). And to enable, simply run:
xinput enable 13
Before you use, make sure that you are correctly enabling or disabling based on the device ID. Be extra cautious while enabling or disabling keyboard which might prevent you to type the command while enabling it (although you can use the onscreen keyboard).
Also, note that the device IDs can vary based on your system, and also they might get changed after every reboot if you plug-in any devices. So, careful while using this command in a shell script for automation.
This trick is very handy when you have multiple keyboards, mouse, or touch devices attached to the system. You can then disable or enable as per your need to prevent any accidental use of devices such as a touchpad.
You can do lots of quick configuration with your connected devices including the touch inputs.