GNOME Desktop: This article explains how to automatically disable the laptop touchpad when an external mouse is plugged in and how to disable the touchpad while typing.
The GNOME Settings app has various options for mice and touchpads, including setting the speed, natural scrolling, and more. You can even disable the touchpad permanently from there. But there’s no option to disable the laptop touchpad while using an external mouse, or to disable the touchpad while typing, directly in Settings.
But there are settings for enabling these 2 very useful options, though they are not exposed in the Settings app. For the instructions below to work, you’ll need to be using the GNOME Shell desktop and libinput.
How to automatically disable the touchpad when a mouse is plugged in (GNOME)
To disable the touchpad when plugging in an external mouse, and re-enable the touchpad upon disconnecting the mouse, you can use either Dconf Editor or a command.
But before doing this, I recommend tweaking your touchpad settings in
Settings -> Mouse & Touchpad. That’s because once we enable the option to disable the touchpad while using a mouse, the touchpad settings from the Settings app are no longer available (the Touchpad shows up as disabled, even though it’s enabled if no external mouse is detected; you can configure the touchpad settings once again after enabling it).
Using Dconf Editor, disable the touchpad when plugging in an external mouse by going to
/ org / gnome / desktop / peripherals / touchpad, click on
send-events, disable the
Use default value toggle, then choose
'disabled-on-external-mouse' as the
Custom value. And finally, click the
Apply button at the bottom of the Dconf Editor window (this button appears only after making changes).
If you want to revert this, simply re-enable the
Use default value option.
You can also do this using a terminal, by issuing the following command:
gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled-on-external-mouse
In case you want to undo this, and permanently enable your touchpad, you can use the command below:
gsettings set org.gnome.desktop.peripherals.touchpad send-events enabled
You may also set it to
You might also like: How To Install GNOME 40 On Ubuntu 21.04 Hirsute Hippo For Testing Purposes [PPA]
Alternative: This option doesn’t work for every laptop and every mouse, or at least it didn’t a while back. If it doesn’t work for you, try Touchpad-Indicator as an alternative (available in a PPA for Ubuntu / Linux Mint and in the AUR for Arch Linux / Manjaro; on other Linux distributions you’ll need to install it from source).
Touchpad Indicator also allows you to disable the touchpad when a mouse is plugged in, but it also comes with some other features, like allowing you to enable or disable the touchpad from its menu, and enable or disable touchpad when the application starts or quits.
To access the Touchpad Indicator icon from the panel on GNOME Shell, you’ll need to install the KStatusNotifierItem/AppIndicator Support extension or similar (this is installed by default on Ubuntu).
There’s also a Touchpad Indicator GNOME Shell extension (its description mentions that it supports up to GNOME Shell 3.36), which tries to achieve the same thing. It does not support Wayland.
You might also like: Touche Is A New GUI To Configure Touchegg (Multi-touch Gesture recognizer For Linux)
How to disable the touchpad while typing (GNOME)
Disabling the touchpad while typing is another option that’s not available directly in the GNOME Shell system settings, but you can enable this by using the GNOME Tweaks application.
This option is available in Tweaks under
Keyboard & Mouse. There you should find the
Touchpad section and right under that there’s the option to
Disable While Typing.
You can also disable the touchpad while typing using Dconf Editor (
/ org / gnome / desktop / peripherals / touchpad / disable-while-typing) or using a command:
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing false
In case you want to revert this, and not disable the touchpad while typing, use:
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing true