Tuning the Macbook touchpad in Linux

The default synaptics driver settings in Linux are a little wonky, and are far from the feel of using the touchpad in OSX. I have spent some (read: too much) time tweaking these settings to a much more usable config.

Getting under the hood

Most distributions will automagically load the synaptics driver in X, so I’ll spare those details. If your distro doesn’t do this, a quick google search should lead you to documentation on how to get the driver installed.

The binary you will use to view and tune your touchpad settings is “synclient”. It can read and write touchpad settings real-time, without root privileges. To get a list of your touchpad settings, simply run “synclient -l”. Any of those settings can be modified by running “synclient SettingName=value”.

Sensitivity

The touchpad was far too sensitive by default. The setting “FingerHigh” defines how much pressure must be applied to be considered a touch. The default value of 30 resulted in me being able to move my mouse without even touching the pad. I increased this value to prevent accidental mouse movements.

synclient FingerHigh=50

Tap-to-click

I deplore the click on Macbook touchpads, so tap-to-click is a must for me. When you turn tap-to-click on, the synaptics driver also has a “TapAndDragGesture” setting turned on by default. This setting allows you to click-drag by doing a double-tap, then moving the mouse. With this setting enabled, I was often getting in situations where I would get mistakenly stuck in the click-drag gesture and drag windows all over the screen. I don’t click-drag very often, so I disabled this setting.

I also enabled two-finger tap and three-finger tap to be my right and middle click, respectively.

synclient TapButton1=1
synclient TapButton2=2
synclient TapButton3=3
synclient TapAndDragGesture=0

Corner buttons

The touchpad has support to consider a tap in a specific corner to be read as a mouse button press. By default, the top-right corner is bound to the right mouse button. My palm continually grazed the top-right corner on the mouse pad, resulting in random right clicks while I was typing. I disabled all of my corner buttons to prevent confusion.

synclient RTCornerButton=0
synclient RBCornerButton=0
synclient LTCornerButton=0
synclient LBCornerButton=0

Palm detection

The synaptics palm detection is disabled by default. Enabling this will help a lot with your palm causing mouse movements or clicks. This setting has two tunables called “PalmMinWidth” and “PalmMinZ” which define how wide and heavy a press must be to be considered a palm. The defaults worked for me, so I left those settings alone.

synclient PalmDetect=1

Saving your settings

In the days of HAL, you could place all of these settings in a hal policy that would get applied automatically. Since HAL is now deprecated, and I don’t know of a clean way to do this in UDEV, the remaining option is to configure the settings in xorg. I have come up with a somewhat clean way of handling this. Please note that I am running Ubuntu 10.10.
1. Create the directory /etc/X11/xorg.conf.d
2. Drop a file with your configs in there called “60-synaptics.conf”. (The xorg driver has some defaults stored in a file beginning with “50”, which is why I used “60” to override them.)

Here is what my config file looks like:

Section "InputClass"
  Identifier "touchpad"
  Driver "synaptics"
  MatchIsTouchpad "on"
  MatchDevicePath "/dev/input/event*"
  Option "FingerHigh" "50"
  Option "RTCornerButton" "0"
  Option "RBCornerButton" "0"
  Option "MinSpeed" "0.7"
  Option "MaxSpeed" "1.7"
  Option "SHMConfig" "on"
  Option "TapAndDragGesture" "off"
  Option "PalmDetect" "on"
EndSection

Further Reading

If you are using a Debian based distro, “man synaptics” will give you information on all of the tunable options for the synaptics driver. This info is also available here.

Share and Enjoy:
  • StumbleUpon
  • Facebook
  • Twitter
  • Reddit
Tuning the Macbook touchpad in Linux

48 thoughts on “Tuning the Macbook touchpad in Linux

  1. chris says:

    Definitely helpful. I still need to find a balance between touch to click being so sensitive that I randomly click everywhere, and it not always clicking when I want it to though. 45 seems to be the best balance so far.

  2. Brother, thank you!!!

    I have been battling my touchpad for ages. The cursor randomly clicked in different places. Text would get selected (and then as I type it would get deleted). My touchpad made me seem an email moron.

    Your tips made it all better — and your explanation of the settings superb.

    Much thanks,

    Ehud
    Tucson AZ US

  3. I just started running Ubuntu 12.04 natively on a MacBook Air, and this blog post has saved me from tearing my hair out. Thank you!

    The only thing I’ll add is that in my case (I’m running GNOME Shell and Cinnamon), putting a config file in /etc/X11/xorg.conf.d/ seemed to change some of the settings but not all of them. Even adding a shell script to run the synclient commands individually and adding that to my desktop startup applications didn’t seem to work – I have to run the script after having fully logged in. My guess is that the desktop environment is overriding these settings after login.

  4. Musti says:

    Can you also say, what i should do with this codes?
    I am with my macbook new on ubuntu and dont know how i can activate my trackpad.

    i copy your codes and paste it in terminal but it said unknown parameter.
    what should i do?

  5. Sarah says:

    Thank you. This is just was I was looking for. The trackpad on my Macbook Air running Slackware was far too sensitive without palm detection enabled.

  6. Thanks a lot! I really think that palm detection and 50 MaxFinger should be set as the default settings in Linux for Macbook trackpads.

    Unfortunately the pointer speed settings don’t change with these settings in Ubuntu. Only the acceleration in the control-center does anything and that’s not much to play with.

  7. Brian says:

    Hello!

    I have a disability that affects the use of my hands, and as such I must use the two physical buttons that are part of my netbook’s touchpad. Unfortunately, the double-click threshold is much too quick, and I cannot for the life of me figure out which synclient setting slows it down. Can you offer any advice?

    Many thanks,
    Brian

  8. Lorenzo says:

    the days of HAL??? what is that?

    I am completely new to Linux and Ubintu, I installed it on a MacBookPro and the touchpad does not work as expected:
    1) If I click, the item does not stay selected;
    2) If I want to drag an item (with one finger to hold, plus another finger to actually drag, as in Windows) it does not work, and it wants you to do it with just one finger.
    3) I cannot select text
    4) As soon as I move the cursor over something, it gets selected very easily, even if I don-t want to.

    What do I do?
    I go to Terminal and then … ? What do I type ?
    and how do I know what driver for the touchpad I have installed?

    Can you privide assistance step by step?
    Thanks!

  9. Frederick Mwangi says:

    Thank you so much you settings were a good baseline to get me started. This was really annoying and my distros sample configs weren’t helping. Saved my some time of going through with configs

  10. Bob Rosset says:

    Nice solution mate. Thanks for this. I’m wondering if the same might work to remap keys. I’m using xmodmap, but it does get undone after some amount of time, I found inside /etc/X11/xorg.conf.d/ a 00-keyboard.conf and I’m wondering if this is what replace my xmodmap configuration.

    Anyway… if you have any clue, I’m more than happy to know about it.

  11. glinzer says:

    In Lubuntu 14 the solution is to edit the ~/.config/lxsession/Lubuntu/autostart file — or create it in Leafpad if it’s not there. Then add:
    @synclient TapAndDragGesture=0
    @synclient FingerHigh=50
    (add as many more as you like)
    This worked for me.

  12. Dann says:

    I didn’t want to fiddle with xorg configurations so I slapped the commands I needed into my ~/.bashrc file.

    Thanks for the post.

  13. Anonymous says:

    have you found any way to deal with the two-finger scroll actuating no matter what distance apart your fingers are? i’ve played with so many settings in synclient and no matter what i change, the scrolling is ever-present, even when my two touch points are nowhere near each other. … i’d love to “get under the hood” and figure out a MaxTwoFingerW setting.

  14. (Personal Computers) First off, I’m not a power user by any means. I need a laptop for basic copumting, web surfing, video streaming, media playing, etc. I am not expecting this machine to run Crysis or anything like that. This laptop is PERFECT for students and those interested in a quality laptop that will handle most anything you throw at it.I play some games on my laptop with absolutely no issues. Minecraft runs well, so do my hidden object games, and I even tried slender man all played magnificently. The screen is really nice, also you can definitely tell it’s an HD screen while streaming videos or playing games, everything just seems to pop off the screen.All in all I’m super happy I chose this computer, would definitely buy from Dell via Amazon again *EDIT*After installing some more games I’ve had great results. I’m not much of a gamer, but Fallout 3, Mass Effect (1 and 2), Borderlands, and Amnesia are all working well!*Edit*Had it for a month now and it’s still great! I’ve been playing some more graphic intensive games and the computer is handling them very well on medium settings. Everything is still lightning quick.

  15. Quantumflux says:

    Just wanted to say thank you!

    I’ve wasted untold hours futzing and tweaking touchpad settings on linux–all in hopes of reaching a workable state after being spoiled by the flawless MacBook Pro glass touchpad.

    Despite perusing discussion boards, blog posts, etc., I failed to find the vaunted elixir that would work without drawbacks. Thus I relied instead on “clicking” as a compromise.

    But with your guidance, nirvana at last! On my Dell XPS 9550 running Ubuntu 16.04, I now have a quality touchpad that works essentially as well as the MacBook. Much appreciated!

    Knock on wood of course… Given the long history of touchpad issues on linux (and Windows), nirvana is likely only a few software updates away from purgatory :-).

Leave a Reply

Your email address will not be published.