You can disable the touchpad on boot up by creating a .desktop
entry in your /.config/autostart/
directory.
In order to perform that, follow the below steps.
First we need to create the desktop entry in .config/autostart/
in the home directory of our user using the following command.
touch /home/<user>/.config/autostart/touchpad.desktop
(file name is optional)
then we need to add entries in the file and make the file executable.
vim /home/<user>/.config/autostart/touchpad.desktop
and paste the following in that file.
[Desktop Entry]
Name=Disable touchpad
GenericName=Touchpad disabler
Comment=Disables touchpad
Exec=xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
StartupNotify=true
Terminal=false
Type=Application
Name=touchpad.desktop
save the file and exit the editor.
And make it executable using the following steps
chmod 755 /home/<user>/.config/autostart/touchpad.desktop
Reboot and check. Your touch pad would be disabled in your login.
To enable tocuhpad after disabling it, you may run the following in a terminal.
xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1
Note that this would enable touchpad only for the current session. You have to remove the desktop entry or change the value from 0
to 1
in order to enable the touchpad on boot up.
If you want to disable the touchpad only and not the physical buttons (Left and right click), then
replace Exec=xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
to
Exec=synclient TouchpadOff=1