Everything is Broken

Ubuntu Touchpad toggle tweak

I’ve been getting irritated with the touchpad on this new Dell Vostro 1400. I type for a while, and then my palm touches the touchpad, sending the pointer skimming into the line above, or clicking on buttons I don’t want to click on. So, I looked around and figured out a solution. Over the past two years, I’ve had to update this post for every single new version of Ubuntu, which has been a pain, so look for the heading below which corresponds to your version of Ubuntu.

Ubuntu Hardy 8.04

First of all, you need to edit your /etc/xorg.conf file, for which you’ll need root privileges – use sudo.You just need to add one line in the input device section, which is the one in bold below. (Intrepid 8.10, see below)

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizEdgeScroll"       "0"
        Option          "SHMConfig"
EndSection

OK, now after you restart X, by logging out and in again, you can turn off the touchpad with

    synclient TouchpadOff=0

And on with

    synclient TouchpadOff=0

I put this together in a script which will look to see if it is on or off, and toggle it to the opposite.

if synclient -l | grep TouchpadOff | grep 1
then
    synclient TouchpadOff=0
else
    synclient TouchpadOff=1
fi

I attached the script to an icon in my toolbar using the Add to Panel > Launcher route. Now I just have to click to toggle it off and on.

Ubuntu 8.10, Intrepid Whatsit

While the script above still works, editing xorg.conf doesn’t work any more, as Ubuntu is moving functionality out of that file. So, instead of that we create a file here.

sudo nano /etc/hal/fdi/policy/shmconfig.fdi

and cut and paste the following into it, saving afterwards.

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<deviceinfo version=”0.2″>
<device>
<match key=”input.x11_driver” string=”synaptics”>
<merge key=”input.x11_options.SHMConfig” type=”string”>True</merge>
<merge key=”input.x11_options.HorizEdgeScroll” type=”string”>1</merge>
</match>
</device>
</deviceinfo>

This file only works with Synaptics Touchpad driver. If you have another touchpad, the filename may be different. There are hundreds of other options which you can activate in this file, but the SHMConfig line is the one you need to allow the script to work.

OK, now you’ve done that, the commands and script above should work.

Ubuntu 9.04 Jaunty Jackass

…. it should work unless you upgrade to 9.04 that is. Now neither of those methods work for disabling the touchpad, which is causing me no end of irritation. So now there’s a third solution which I discovered after finding the new touchpad control panel under System > Preferences > Mouse > Touchpad. In there there is a switch to turn off the touchpad, so I figured there must be a way to change this setting with gconftool. Here’s what  came up with:

gconftool-2 –toggle /desktop/gnome/peripherals/mouse/touchpad_enabled

This works from the commandline, in a script and even typed directly into a launcher button on your menubar for lightning fast toggling. Which is the only way to toggle.

Ubuntu 9.10 Karmic Koala

Why do they have to change this every frigging version. OK, so back to a script into which the following is inserted.

if xinput list-props "SynPS/2 Synaptics TouchPad" | grep "Device Enabled" | grep 1
then
    xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 0
else
     xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 1
fi

Then assign this to a key (in my case F6) using System > Preferences > Keyboard Shortcuts. All seems to work again … until the next upgrade.

This entry was posted on Monday, November 10th, 2008 at 4:41 pm and is filed under General IT, Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Physician Heal Thyself: When WordPress Themes go Bad
Ubuntu 8.04 Dual Head setup on Dell Vostro. »

3 Responses to “Ubuntu Touchpad toggle tweak”

  1. karatedog Says:
    September 14th, 2009 at 6:56 am

    It is much simpler under Ubuntu 9.04 Jaunty Jackass.
    Just enable SHMConfig through that .fdi file of yours, and use:
    synclient TouchpadOff=1 to turn off the touchpad
    synclient TouchpadOff=0 to turn it on

    (I hate this reversed behavior…enabling the Off function, grrr!)

  2. karatedog Says:
    September 14th, 2009 at 6:57 am

    Oh, I see, that was the same you just wrote. But hey, it is working well :-)

  3. admin Says:
    September 17th, 2009 at 3:37 pm

    Hi karatedog.

    Yup, I’m not keen on how things keep changing from version to version. The fix you describe works for 8.10, but I find the option for 9.04 which I describe above even easier. I basically replaced my script with this line

    gconftool-2 –toggle /desktop/gnome/peripherals/mouse/touchpad_enabled

    … and then assigned it to a hotkey in System > Preferences > Keyboard Shortcuts. So now all I do is press ctrl-alt-f6 and it toggles from one state to another. This means I can even turn my touchpad off when I don’t have a mouse plugged in, and just want to type for a while without interruption. Neat.

Leave a Reply

CAPTCHA Image CAPTCHA Audio
Refresh Image
  • Recent Posts

    • ClamAV reporting Outdated version
    • Adventures in unbricking a router
    • One Line Guitar Tuner
    • Captcha Madness
    • Ubuntu upgrade 9.04 to 9.10
  • Sing for your supper

  • Static

    • About
    • Privacy Policy
  • Tags

    apathy apple calendar chkconfig collanos cross-platform eee evolution firmware google grub hotspot id card lightning Linux Mandriva notebook partitioning pclinuxos pclinuxos 2008 Philippines power management re-install sane scanner scheduleworld script Security slow sysv-rc-conf thinkpad thunderbird trust ubuntu ultraportable usb virtualisation vmware vpn wifi wireless workspace sharing xsane yahoo zombie
  • Blogroll

    • Datalude
    • Digital Life
    • Engage the World
  • Archives

    • May 2010
    • April 2010
    • March 2010
    • November 2009
    • October 2009
    • June 2009
    • May 2009
    • April 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • April 2008
    • March 2008
    • February 2008

Everything is Broken runs on WordPress. Theme by Bob. All content Copyright © Datalude 2008+.