How to disable the touchpad in Ubuntu

As I had mentioned in yesterday’s post about configuring Fluxbox on Ubuntu 9.04 on my old Toshiba laptop, I had one nagging issue I couldn’t figure out, namely the rather simple fact that the touchpad wouldn’t stay disabled.

I know this isn’t a big deal for most people, but for me it’s a rather vexing one, and it bothered me that I had to manually do so every single time I logged in.

So this afternoon I took a deep breath, did some more Google searching on the subject, and arrived at an overly-complex (but doable) solution.

Step 1: Enabling SHMConfig

Searching around directed me eventually to the Ubuntu documentation site, which eloquently explains that in order for the various tools — even ones preinstalled like synclient — to talk to the touchpad, something called SHMConfig needs to be turned on.

Since this looked important, I figured I’d do it.

I enabled SHMConfig by opening up a shell and typing this into it:

gksudo gedit /etc/hal/fdi/policy/shmconfig.fdi

This brought up a blank file called "shmconfig.fdi" in GEdit, presumably one whose name means something to whatever is needed to communicate with the touchpad in shared memory.

In that file, I pasted the following code, as directed by the Ubuntu documentation: (click here to see my shmconfig.fdi file)

I then saved that file and rebooted, presumably with SHMConfig now happily enabled.

Step 2: Nothing Can't Be Resolved With A Simple Bash Script

Now that synclient was able to communicate with the touchpad, all I needed was a handy script to make it easy for me to toggle it on and off.

So (also inspired by the Ubuntu documentation), I created a shell script I called "touchpad.sh", by opening up a shell again and typing this into it:

nano touchpad.sh

Into that I pasted the following:

# toggle synaptic touchpad on/off
# get current state

SYNSTATE=$(synclient -l | grep TouchpadOff | awk '{ print $3 }')

# change to other state
if [ $SYNSTATE = 0 ]; then
    synclient touchpadoff=1
elif [ $SYNSTATE = 1 ]; then
    synclient touchpadoff=0
else
    echo "Couldn't get touchpad status from synclient"
    exit 1
fi
exit 0

The next thing to do after creating a new shell script is to make it executable. I did this by typing chmod +x touchpad.sh.

I then edited my /~/.fluxbox/startup file and added a line that says this:

/home/trent/touchpad.sh

So that the script runs on Fluxbox startup and, since the damned touchpad is always enabled by default, the script will toggle it off as soon as I'm logged in.

Just in case I (for some odd reason) actually want to enable it, I also added this line to my /~/.fluxbox/menu file, so that I can easily toggle the touchpad on and off from my Fluxbox menu:

[exec] (Touchpad) {/home/trent/touchpad.sh}

Confused yet? Well, it seems like an awful lot of work to go through to accomplish a silly, simple thing. In Slackware all one has to do to disable the touchpad is simply comment out the appropriate InputDevice section in /etc/X11/xorg.conf, but that file in Ubuntu on this laptop is almost EMPTY (yeah, I know... WTF?).

So I had to go through the above gymnastics to do the same thing, which, I have to say, is not a "user friendly" experience I would expect from a Linux distro that calls itself "Linux for human beings".

In this particular event, I call the score Slackware: 1, Ubuntu: 0, when it comes to ease of use. As always, your mileage may vary.

But I hope that this helps someone else out, in case there are any others out there trying out Fluxbox on top of an Ubuntu installation on a laptop!

Cheers!

About these ads

3 thoughts on “How to disable the touchpad in Ubuntu

  1. Pingback: Fluxbox on Ubuntu: two more problems, two more solutions « The Linux Critic
  2. Pingback: How to disable the touchpad in Ubuntu | Ubuntu-News - Your one stop for news about Ubuntu
  3. This was great information. Thank you for this. This is my first experience with Fluxbox and this little tutorial also made me aware of the .fluxbox/menu file and how to edit it. Thank you for your efforts in finding this information.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s