Tombuntu

Persistent Touchpad Configuration in Ubuntu 11.10

Recently I’ve fixed the tap-and-drag gesture, and swapped the right and middle click gestures on my netbook’s touchpad. I applied the configuration changes for these by adding the synclient configuration commands to Startup Applications. It didn’t take long before I noticed that some changes would revert after I suspended and woke the system. Even adding the changes to my Xorg configuration didn’t make them stick. What’s the deal?

It turns out that GNOME 3 will overwrite some touchpad options with it’s own hardcoded defaults. Whenever GNOME re-detects your touchpad, even after a suspend, it will wipe out your options with its own that cannot be changed.

Fortunately GNOME provides a hook so that after your changes are erased, you can set them again. Using a dconf value, you choose to run your own script.

Here’s how to make your custom touchpad configuration persistent through reboots and even suspends. Start by creating a file to hold your script. Run this command to create a touchpad_settings.sh file in your home directory and open it:

gedit ~/touchpad_settings.sh

Add your synclient commands to this file and save it. Mine looks like this:

synclient SingleTapTimeout=360 FastTaps=1
synclient TapButton2=2 TapButton3=3

Make the file executable:

chmod +x ~/touchpad_settings.sh

Finally, set the dconf setting so GNOME knows where to find your script. Run the following command, but replace tom with your own username:

gsettings set org.gnome.settings-daemon.peripherals.input-devices hotplug-command "/home/tom/touchpad_settings.sh"

You don’t need to set your touchpad options any other way now. GNOME should run your script whenever you log in or wake the system from suspend.

Archived Comments

King

this is the best solution I’ve found anywhere! thanks!

noob

Thanks so much! Perfect solution to my persistent slow touchpad speed. Linux and its community rocks:)

Arnau

Another awsome post.
Thanks!

rolan

Exactly what I needed! You rock!!

Yossi

Thanks. works perfectly.

I also changed the sensitivity and speed this way since the ubuntu settings for it doesn’t seem to have any effect….finally my touchpad works!

Cheers,
Yossi.

sokai

Thanks a lot! - But it seems that there are some problems left -> https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-synaptics/+bug/859474

jake

i am completely new to all this. i have used the terminal to create the file and when i set it it works properly, but i’m using lubuntu, so theres no gnome. how do i get the file to exeute automatically in lxde?
thanks a lot
Jake

David

Just to thank you. The best workaround so far.

dll

Thank you. I found another option which might be simpler and avoids startup scripts.

1. Stop the gnome settings daemon from overriding existing settings (font: Touchpad Synaptics - ArchWiki).

gsettings set org.gnome.settings-daemon.plugins.mouse active false

2. Edit the X11 configuration file for the touchpad.

sudo gedit /usr/share/X11/xorg.conf.d/50-synaptics.conf

and add your button options under the section with the synaptics driver, like so:

Section “InputClass”
Identifier “touchpad catchall”
Driver “synaptics”
MatchIsTouchpad “on”
MatchDevicePath “/dev/input/event*”
Option “LockedDrags” “on”
Option “TapButton1” “1”
Option “TapButton2” “3”
Option “TapButton3” “2”
Option “HorizTwoFingerScroll” “on”
Option “VertTwoFingerScroll” “on”
EndSection

Sam

org.gnome.settings-daemon.peripherals.input-devices doesn’t exist on my ubuntu 11.04

Erik

Happy that I’ve found your solution. It works! I tried many other ways but none of them worked after reboot and suspend mode, some of them only for certain applications.
Yours is now part of my personal wiki “howto live and work with linux on a macbook” ;)

Greetings from raring ringtail on an mbp 9,2.
Erik

sugi

thanks. it is works well for me :)

Respond via email