Not all laptops have a functioning button for toggle the touchpad on and off out of the box with Linux. I've made a script that does this by removing the mouse module from the Linux kernel and then putting it back again to enable the pointer again. This means that the script can be used also on desktop computers to temporarily disable the mouse.
These instructions have been designed and tested for Ubuntu Oneiric (11.10) but should work for other flavours of Linux possibly with minor changes.
These instructions are provided with absolutely no warranty.
Put the following in a file,
e g "/usr/local/bin/toggle-touchpad
"
This script will check if the module is loaded, remove it in
case it is, or put it back if it is not loaded.
sudo chown root /usr/local/bin/toggle-touchpad
sudo
bash
.
Warning: the following part of the instructions is dangerous and may leave your installation crippled if done wrong or not not working for other reasons! If things fail you might have to use a live media to remove the file described below.
/etc/sudoers.d/sudo-toggle-touchpad
" with these
contents:
%users ALL = NOPASSWD: /usr/local/bin/toggle-touchpad
The file must end with a newline. If your user is not
in the users
group, replace %users
with your user name (without the percentage sign).chmod 440 /etc/sudoers.d/sudo-toggle-touchpad
sudo
without problems. If not, remove the file
/etc/sudoers.d/sudo-toggle-touchpad
.
Warning: exit the
root shell only when you know that sudo
works.
sudo toggle-touchpad
.