Touchpad on/off

My OS is openSUSE 11.2, GNOME. Where can I a setting for ON/OFF touchpad? :expressionless:

Hi
Should be under the Control Center->Mouse, touchpad tab.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.39-0.3-default
up 1 day 20:34, 2 users, load average: 0.06, 0.05, 0.01
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

From a shell you can type

synclient TouchpadOff=1

I wrote the following script to toggle the touchpad. Just save the following to a file, make it executable and create a desktop shortcut to invoke it.


#!/bin/sh

override_state()
{
        local num_mouse=$(/usr/sbin/hwinfo --mouse | grep "Hardware Class" | wc -l)

        if  $num_mouse -gt 1 ]; then
                echo $1
        else
                echo 0
        fi
}

if  -e ~/.touchpad ]; then
        STATE=$(cat ~/.touchpad)
else
        STATE=1
fi

# Don't disable the touchpad if its the only mouse in the system.
STATE=$(override_state $STATE)

synclient TouchpadOff=$STATE

if  $STATE -eq 1 ]; then
        echo 0 > ~/.touchpad
else
        echo 1 > ~/.touchpad
fi

I never did figure out a way of automatically re-enabling the touchpad when the mouse gets removed but it does the job.

see here that I have a setting for mouse/touchpad. but that didn’t work :frowning:

http://lh4.ggpht.com/_-g7SHML2oAI/S0Z1V0kmQXI/AAAAAAAAATQ/30MT1m1hhmA/s512/touchpad.jpg

Hello cpackham,

8 days age I am first time with Linux. I don’t know where can I found a shell?

OK bear with me its been a while since I used gnome.

If I remember correctly you can right click on the desktop and one of the options is “open in terminal”. Failing that the program you’re looking for is called gnome-terminal.

Just try the “synclient TouchpadOff=1” thing first. Some laptops don’t use the synaptic driver so if that command doesn’t work then my script won’t work either. Use “synclient TouchpadOff=0” to turn the touchpad back on. If that works then read on.

Start up a text editor “gedit” should be available in a gnome installation. Enter the code I posted and save it in the “bin” directory in you home folder (i.e /home/<your username>/bin). Give it a name like “toggle-touchpad.sh”.

From the shell type

chmod +x ~/bin/toggle-touchpad.sh

this will make the script executable. Try it out by typing “toggle-touchpad.sh”. If everything has gone well your touch pad should turn off or on each time you run the script.

If everything is working at this point you just need to create a desktop shortcut that runs the program you’ve just created. Right click on the desktop and one of the options should be “Create Application Launcher” or something like that (in KDE its “create new”->“link to application…”). Set the command to “~/bin/toggle-touchpad.sh” and give it a name and description.

Once you’ve created the desktop shortcut you should be able to drag and drop the shortcut onto the menu bar (Gnome calls it “the panel”). Or you can just leave it on your desktop.

Good luck.

Thank you very much! It work now → Touchpad is disable now! I am very happy :smiley:

FFI: there’s a GUI configurator called Gsynaptics for Gnome. I’m using KDE and it’s also available there too. Gsynaptics addresses tapping, scrolling, accelleration and of course on-off

Figured there probably was. I wrote my script specifically because I wanted a single button that would turn the touchpad off/on from the menubar.

cpackham: Okay, but later I have found something that is possible to touchpad off.
OpenSUSE 11.2:

  1. Configuration window
  2. Touchpad (hardware)

I did not know previously for which file I have installed touchpad. :expressionless:

swerdna: Yes, I didn’t know first. I have learn now.