If you are using a Linux laptop on a desk and have a high-quality USB or Bluetooth mouse connected, the built-in trackpad becomes a massive liability. As you type code or long documents, the heel of your palm will inevitably brush against the touchpad, causing the cursor to jump erratically across the screen, highlighting and deleting random blocks of text.
While some desktop environments (like GNOME) have a “Disable touchpad while typing” toggle in their GUI settings, this feature is notoriously unreliable and often fails to detect palm rests properly. If you want absolute certainty that your cursor will not move unless you touch your physical mouse, you should forcefully disable the touchpad hardware at the driver level using the xinput command.
Step 1: Identify the Touchpad ID
Before you can disable the hardware, you must find out exactly what ID number the X11 server has assigned to your specific touchpad.
- Open your terminal.
- Type the following command:
xinput list - Press Enter.
This will output a large, messy tree diagram of every single input device connected to your laptop (keyboards, webcams, mice, etc.).
Look carefully under the “Virtual core pointer” section. You are looking for a line that contains the word “Touchpad” (e.g., SynPS/2 Synaptics TouchPad or Elan Touchpad). Note the exact id=XX number located to the right of that name (for example, id=14).
Step 2: Disable the Touchpad
Now that you know the device ID, you can tell the X11 server to cut off all input from that specific piece of hardware.
- In the terminal, type the following command (replace
14with your actual touchpad ID):xinput disable 14 - Press Enter.
The change is instantaneous. Run your finger across the laptop’s trackpad; the cursor will completely ignore you, but your external USB mouse will continue to work perfectly.
Step 3: Re-Enable the Touchpad
If you pack up your laptop to take it to a coffee shop and forget your USB mouse, you will need to turn the touchpad back on. Fortunately, you can do this entirely using the keyboard.
- Press Ctrl + Alt + T to open a new terminal window.
- Type the following command (using the same ID number):
xinput enable 14 - Press Enter. Your trackpad will instantly come back to life.
Alternative: Disabling by Device Name
Device IDs (like “14”) can sometimes change if you reboot the laptop or plug in a different USB hub. If you plan to script this process, it is much safer to disable the touchpad using its exact string name (enclosed in single quotes) rather than its ID number.
For example, if the xinput list command named your device SynPS/2 Synaptics TouchPad, you can disable it permanently using this command:
xinput disable 'SynPS/2 Synaptics TouchPad'
This ensures the command will always target the correct hardware, regardless of what ID number the system assigns it upon booting.