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

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 1

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

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 2

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.

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 3

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.

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 4

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

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 5

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”

how-to-swap-the-two-and-three-finger-touchpad-tap-actions-on-ubuntu photo 6

Article How to Swap the Two and Three Finger Touchpad Tap Actions on Ubuntu compiled by Original article here

More stories

How to Downgrade Packages on Ubuntu

Ubuntu’s Update Manager keeps your packages at the latest version, but occasionally a new package version may not work properly. You can downgrade an installed package and lock it at a specific version to prevent it from being updated.

How To View and Write To System Log Files on Ubuntu

Linux logs a large amount of events to the disk, where they’re mostly stored in the /var/log directory in plain text. Most log entries go through the system logging daemon, syslogd, and are written to the system log.

The Best How-To Geek Articles for June 2012

This past month we covered topics such as why you only have to wipe a disk once to erase it, what RSS is and how you can benefit from using it, how websites are tracking you online, and more. Join us as we look back at the best articles for June.

Desktop Fun: Starships Wallpaper Collection Series 2

The starships shown in our favorite sci-fi serials come in all shapes and sizes, serve different purposes, and make us yearn to have one to call our own. Travel among the stars on your desktop with the second in our series of Starships Wallpaper collections.