Update: Below are what I believe to be the best settings available to tune a Linux touchpad to feel like a Macbook Pro touchpad, but it still isn’t perfect, and a year of research had led me to believe that it can’t be perfect without bigger changes to the underlying Linux drivers. I’ve written this follow up post to explore paths forward. Original post follows…
Since my last laptop upgrade to a Dell Precision, I have made it an ongoing project to try to match my laptop (running Arch via Antergos) touchpad to the smooth & predictable operation of a Macbook Pro. It has been a long road, but at this point I have a setup that I think compares favorably to a Macbook experience.
In my previous entry, I covered the three available options for Linux touchpads before settling on mtrack as my touchpad driver of choice. In the weeks since, I have walked back this decision due to the jittery behavior of the mtrack driver when one slides a thumb in an effort to click. I frequently found myself barely missing my click target, and that’s no way to live.
So I returned to review my three options. In spite of its halting development progress, the next best option seemed to be the Synaptics driver. The fact that it was initially included as the default drive for Arch added to its credibility.
Having opted for Synaptics, the foremost challenge became locating a single concise & authoritative source to explain all available Synaptics touchpad driver options. Read on for a link to that source. I will also share my current touchpad configuration, with annotations on the updates I made to maximize the consistency & elegance of my touching experience.
Installation
Since Synaptics is the default driver for many Linux distros (including Ubuntu and Antergos, to my knowledge), you might well be running the Synaptics driver already. The easiest way to determine is to run
cat /var/log/Xorg.0.log | grep synaptics
If you see output like the following, you’re in good shape:
[ 16885.807] (II) LoadModule: "synaptics"
[ 16885.808] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[ 16885.808] (II) Module synaptics: vendor="X.Org Foundation"
[ 16885.808] (II) Using input driver 'synaptics' for 'DLL07BF:01 06CB:7A13 Touchpad'
If not, chances are there is a configuration file for libinput or mtrack that has a lower alphanumeric file name in either /etc/X11/xorg.conf.d/
, the first directory Xorg looks for touchpad config files, or /usr/share/X11/xorg.conf.d/
its secondary location. To get your laptop to choose Synpatics over other drivers, you must change the filename of your Synaptics driver config file to have a lower alphanumeric precedence than its competitors. I.e.,
bill /usr/share/X11/xorg.conf.d $ ls -l
total 16
-rw-r--r-- 1 root root 1350 Dec 25 05:03 10-quirks.conf
-rw-r--r-- 1 bill users 1935 Jan 7 11:03 30-synaptics.conf
-rw-r--r-- 1 root root 951 Dec 20 09:24 40-libinput.conf
-rw-r--r-- 1 root root 1753 Nov 18 2016 70-mtrack.conf
In my case, my Synaptics driver config file lives at /usr/share/X11/xorg.conf.d/30-synaptics.conf
. The “30-” that my config file begins with is a lower number than my libinput or mtrack config files contain, so Xorg chooses to use Synaptics and ignore the other drivers.
Configuration
In my past post, I lauded mtrack for going big on configurability, noting the 50-100 different options available on differing versions of mtrack. The good news is that Synaptics has even more options available than Mtrack. The bad news is that you’re not going to find any one complete & accurate source to learn about all of the options available to you.
This page is the best you’re going to find. It’s pretty good.
After reading through the litany of options available, and experimenting in real world usage, the final Synaptics config file I settled on actually implements relatively few custom options:
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
# Enabling tap-to-click is a perilous choice that begets needing to set up palm detection/ignoring. Since I am fine clicking my touchpad, I sidestep the issue by disabling tapping.
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
# Using negative values for ScrollDelta implements natural scroll, a la Macbook default.
Option "VertScrollDelta" "-80"
Option "HorizScrollDelta" "-80"
# https://wiki.archlinux.org/index.php/Touchpad_Synaptics has a very buried note about this option
# tl;dr this defines right button to be rightmost 7% and bottommost 5%
Option "SoftButtonAreas" "93% 0 95% 0 0 0 0 0"
MatchDevicePath "/dev/input/event*"
EndSection
You’ll note that this config file doesn’t setup coasting after a two-finger scroll, since Synaptics enables this by default. The -80 values for scroll delta correspond closely with the rate at which a Macbook will scroll with two fingers. The greatest difference between my Linux and Macbook config is that I have enabled a slight area at the bottom right of my touchpad to function as my right click. After several hours of usage, I’ve found this area sized such that I only end up right clicking when I make an effort to go for the bottom right corner. It’s a handy optimization that prevents me from needing to remove right click from the touchpad entirely.
On to the finer details
The previous post lamented how challenging I had found it to tweak values for the touchpad properties without restarting Lightdm (logging out and logging in again). Since then, I’ve discovered two means that allow experimenting with different touchpad values without requiring a log out/log in cycle. Both methods will allow you to precisely configure your touchpad settings without needing to log out and log back in.
The first method is via xinput, the second via synclient.
Using xinput
The greatest benefit to using xinput
directly in changing touchpad settings is that it will work with either the Synaptics, libinput, or mtrack drivers. The second method I’ll outline below (synclient) only works with Synaptics.
To configure your settings using xinput, start by running xinput --list
. Note which ID corresponds to your touchpad (for me, it’s ID 13), and then run xinput --list-props id
. For example:
$ xinput --list-props 13
Device 'DLL07BF:01 06CB:7A13 Touchpad':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (274): 1
Device Accel Constant Deceleration (275): 2.500000
Device Accel Adaptive Deceleration (276): 1.000000
Device Accel Velocity Scaling (277): 12.500000
Synaptics Edges (282): 49, 1179, 50, 878
Synaptics Finger (283): 25, 30, 0
Synaptics Tap Time (284): 180
Synaptics Tap Move (285): 67
Synaptics Tap Durations (286): 180, 180, 100
Synaptics ClickPad (287): 1
Synaptics Middle Button Timeout (288): 0
Synaptics Two-Finger Pressure (289): 282
Synaptics Two-Finger Width (290): 7
Synaptics Scrolling Distance (291): -80, -80
Synaptics Edge Scrolling (292): 0, 0, 0
Synaptics Two-Finger Scrolling (293): 1, 0
Synaptics Move Speed (294): 1.000000, 1.750000, 0.129955, 0.000000
Synaptics Off (295): 0
Synaptics Locked Drags (296): 0
Synaptics Locked Drags Timeout (297): 5000
...
Each of these property values correspond to properties you’ll find in the Synaptics configuration documentation. To change a value, you would then use xinput set-prop
, for example:
xinput set-prop --type=int "DLL07BF:01 06CB:7A13 Touchpad" "Synaptics Scrolling Distance" -70 -70
You’ll note the first string is the copy-pasted name of my touchpad from xinput --list
, the second string is the copy-pasted name of the setting that was shown via –list-props, and all of the settings that follow are the values to be used. After running the command above, when I re-run xinput --list-props id
I see Synaptics Scrolling Distance (291): -80, -80
, meaning my natural scroll is about 15% faster than before.
Using synclient
One benefit unique to the the Synaptics driver is that it comes with a dedicated utility for configuring its setting values. You can see all current applied settings by invoking synclient
. You’ll see something like
$ synclient
Parameter settings:
LeftEdge = 49
RightEdge = 1179
TopEdge = 50
BottomEdge = 878
FingerLow = 25
FingerHigh = 30
MaxTapTime = 180
MaxTapMove = 67
MaxDoubleTapTime = 180
SingleTapTimeout = 180
ClickTime = 100
EmulateMidButtonTime = 0
EmulateTwoFingerMinZ = 282
EmulateTwoFingerMinW = 7
VertScrollDelta = -70
HorizScrollDelta = -70
...
Again, you can consult the Synaptics settings documentation to map these esoteric names into actual behavior. Setting a new value is then simply a matter of running synclient VertScrollDelta=-80
Persisting configuration changes
After you’ve tweaked your touchpad to your satisfaction, you’ll need to propagate all your settings changes back into the config file we discussed in step one. The only bit that can make this challenging is if you used synclient, the variable names used by synclient can differ significantly from those that are known to xinput when it goes to configure your touchpad upon login.
If you’re not sure how your synclient values correspond to values you would feed to the Synaptics driver config file, use the steps from the “Using xinput” section above to list all the properties for your touchpad. Here, you’ll be able to see the config setting names that xinput knows for your touchpad, as well as the values it is currently using. For example, xinput --list-props
tells me that after tweaking in synclient, I set up my button regions as follows:
Synaptics Soft Button Areas (314): 1079, 0, 760, 0, 0, 0, 0, 0
I can then copy those into my config file 30-mtrack.conf
as follows:
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
...
Option "SoftButtonAreas" "1079 0 760 0 0 0 0 0"
EndSection
After the setting values have been saved in your configuration file, they will be applied automatically upon restart/login.