SEARCH

How-To Geek

How to Swap the Two and Three Finger Touchpad Tap Actions on Ubuntu

fingers on laptop touchpad

By default, Ubuntu uses a two-finger tap for right-click and a three-finger tap for middle-click on laptop touchpads. You can swap this behavior, but Ubuntu doesn’t provide a graphical utility for configuring it.

Swapping this behavior is simple and only involves running a command or two — however, making your changes persistent requires creating a script and telling GNOME to automatically run it when the system boots or resumes from suspend.

Image Credit: Michael Mol on Flickr

Swap Two Finger & Three Finger Taps

Launch a terminal and run the following command to swap the tap behavior:

synclient TapButton2=2 && synclient TapButton3=3

image

These synclient commands tell “TapButton2” (two-finger tap) to produce action 2 (middle-click) and “TapButton3” (three-finger tap) to produce action 3 (right-click).

After running these commands, your tap gestures will be reversed. However, this setting isn’t persistent across system restarts or suspend and wake cycles.

Making Your Configuration Persistent

To make this setting persistent, you’ll have to create a special script and tell GNOME to run it. You can’t just add the script to your startup applications or Ubuntu will overwrite the touchpad’s settings when your system from suspend.

To create the script, open a text editor such as Gedit, which you can launch from the Dash.

image

Add the commands used above to a new text file like so:

synclient TapButton2=2
synclient TapButton3=3

Save the file with the .sh file extension — for example, you could name it touchpad.sh.

image

After you’ve saved the file, launch a terminal and run the following command to make your new script executable, replacing /home/name/touchpad.sh with the path to your script:

chmod +x /home/name/touchpad.sh

image

Next, run the following command — replacing /home/name/touchpad.sh with the path to your script — to tell GNOME to run your script whenever an input device is connected (for example, when your system boots or resumes from suspend). This makes your settings persisent:

gsettings set org.gnome.settings-daemon.peripherals.input-devices hotplug-command “/home/name/touchpad.sh”

image

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 07/13/12

Comments (2)

  1. Andrew

    Ok, I tried this and now Ubuntu freezes at the login screen…not sure it’s related, but that’s all I changed.

  2. Darren

    Interesting article… I usually do it by adding Option “TapButton2″ “2”
    to /usr/share/X11/xorg.conf.d/50-synaptics.conf
    (section “touchpad catchall”)

    Don’t know about non-Ubuntus though.

Enter Your Email Here to Get Access for Free:

Go check your email!