To enable or disable touchpad or any other hardware device on linux you need to make use of xinput command.
The official manpage describes xinput as:
xinput is a utility to list available input devices, query information about a device and change input device settings.
To enable/disable touch pad we need to run xinput list. When I run
xinput list I get the following output.
As you can see above I own a HP laptop, so there is HP based devices in my system.
What we need is the id of the touchpad, in my case that is 11.
To disable the touchpad do following:
$ xinput set-prop 11 "Device Enabled" 0
To enable touchpad do following:
$ xinput set-prop 11 "Device Enabled" 1
Map these to any key combination in your window-manager or you can make alias for your shell so you can execute this command easily.
LastMod 2020-04-13 (0d2127a)