Skip to main content

Linux: The Least Bad Synaptics Configuration for a MacBook Running Ubuntu

In my last post, Linux: My Mouse Ate My Homework!, I explained how dangerous it is to have a touchpad configuration that isn't finely tuned when you're running Ubuntu on a MacBook. For some reason, I've always been happy with the touchpad configuration under OS X, but I've never managed to set it up just right under Ubuntu. I spent three hours yesterday reading the synaptics man page (which is very well written, but not always helpful) and tweaking the settings.

In this post, I'm going to document the settings I came up with. I invite you to submit comments if you've found settings that feel more natural and are less likely to cause inadvertent mayhem. I'd be especially interested if you managed to get palm detection working.

First, start by creating /etc/hal/fdi/policy/appletouch.fdi as root:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
To learn more about this file: man 4 synaptics

Check for updates to this configuration here:
http://jjinux.blogspot.com/2009/09/linux-least-bad-synaptics-configuration.html

References:
https://help.ubuntu.com/community/MacBook4-1/Jaunty#Touchpad%20(appletouch)
https://help.ubuntu.com/community/MacBook_Santa_Rosa#Disable%20Touchpad%20While%20Typing
http://linuxwisdom.blogspot.com/2007/07/macbooksynaptics-trackpad-configuration.html
https://help.ubuntu.com/community/MacBook%20Aluminum#Trackpad
-->

<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">

<!--
You need this turned on in order to run syndaemon. Once you have it turned on, you can run
"synclient -l" to look at your existing settings, and "synclient VAR=VAL" to change settings at runtime.
-->
<merge key="input.x11_options.SHMConfig" type="string">true</merge>

<!-- Disable tapping. My palm always causes the context menu to pop up, and I hate that. -->
<merge key="input.x11_options.TapButton1" type="string">0</merge>
<merge key="input.x11_options.TapButton2" type="string">0</merge>
<merge key="input.x11_options.TapButton3" type="string">0</merge>

<!-- Set this to 30 and 40 if you want to have to press harder. -->
<merge key="input.x11_options.FingerLow" type="string">10</merge>
<merge key="input.x11_options.FingerHigh" type="string">30</merge>

<!-- This has to do with acceleration. It's a matter of taste. -->
<merge key="input.x11_options.AccelFactor" type="string">0.10</merge>
<merge key="input.x11_options.MaxSpeed" type="string">1.2</merge>
<merge key="input.x11_options.MinSpeed" type="string">0.5</merge>

<!--
2 fingers + click = right mouse button
3 fingers + click = middle mouse button
-->
<merge key="input.x11_options.ClickFinger2" type="string">3</merge>
<merge key="input.x11_options.ClickFinger3" type="string">2</merge>

<!-- Set the speed of scrolling. -->
<merge key="input.x11_options.VertScrollDelta" type="string">20</merge>
<merge key="input.x11_options.HorizScrollDelta" type="string">20</merge>

<!--
You might want to disable one or the other of these. Of course, you'll need a multi-touch compatible
touchpad to use TwoFingerScroll.

<merge key="input.x11_options.VertTwoFingerScroll" type="string">false</merge>
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">false</merge>
<merge key="input.x11_options.HorizEdgeScroll" type="string">false</merge>
<merge key="input.x11_options.VertEdgeScroll" type="string">false</merge>
-->
<merge key="input.x11_options.HorizEdgeScroll" type="string">false</merge>
<merge key="input.x11_options.VertEdgeScroll" type="string">false</merge>

<!-- This never seems to work for me, but hopefully one day it might. -->
<merge key="input.x11_options.PalmDetect" type="string">1</merge>
</match>
</device>
</deviceinfo>
Now, use System :: Preferences :: Startup Applications, and create a new startup item "syndaemon -d -t" and then reboot. Read the file above to learn how to tweak these settings at runtime once you've rebooted.

Comments

jjinux said…
By the way, my MacBook has hardware version 4,1.
jjinux said…
Updated:

* Added Palm detection.
* Left some things to their default.
Brandon L. Golm said…
you're a sinner and we are no longer friends
jjinux said…
hahaha
jjinux said…
Disabled horizontal and vertical edge scroll, although it doesn't appear to have made a difference.
jjinux said…
When you scroll on an empty background, it switches virtual desktops. There's a way to turn this out. I found it here: http://ubuntuforums.org/showthread.php?t=1247943.

sudo apt-get install compizconfig-settings-manager

System :: Preferences :: CompizConfig Settings Manager:

Viewport Switcher:

Desktop-based Viewport switching:

Disable Move Next and Move Prev.
Bob Van Zant said…
Reboot? Reboot!? JJ. Reboot!? Yikes :-)
jjinux said…
No way, dude! Suspend works under Linux on this Mac better than it's ever worked on any PC. I never want to reboot again!!!
dharmaurchin said…
Hi,
even when I set TapButton1=0, synclient -l shows TapButton1=1.
This is the only TapButtonX I dont like.
I have restarted with both computer and modprobe -r appletouch.
Other settings in .fdi file have changed, just not TapButton1.

Can you help me? do you think something is overriding my appletouch.fdi file?

thanx
jjinux said…
I don't know anything specifically about TapButton1, but I do know that some settings get reset all the time, even when waking from sleep. VertEdgeScroll is like that. It doesn't matter what I set it to, I have to reset it everytime my computer wakes from sleep.

By the way, Ubuntu 9.10 is *much* nicer by default when it comes to the trackpad: http://jjinux.blogspot.com/2009/12/linux-im-lovin-ubuntu-910.html
creativesumant said…
A while back I upgraded my Macbook to Ubuntu Feisty Fawn. The installation was extremely smooth, and everything just worked.

But I have tweaked my TrackPad configuration. Make sure to edit the ServerLayout section to use the MacBook Touchpad input device.

Recently I just came across a good article on "Linux"
Here is its link.

Popular posts from this blog

Ubuntu 20.04 on a 2015 15" MacBook Pro

I decided to give Ubuntu 20.04 a try on my 2015 15" MacBook Pro. I didn't actually install it; I just live booted from a USB thumb drive which was enough to try out everything I wanted. In summary, it's not perfect, and issues with my camera would prevent me from switching, but given the right hardware, I think it's a really viable option. The first thing I wanted to try was what would happen if I plugged in a non-HiDPI screen given that my laptop has a HiDPI screen. Without sub-pixel scaling, whatever scale rate I picked for one screen would apply to the other. However, once I turned on sub-pixel scaling, I was able to pick different scale rates for the internal and external displays. That looked ok. I tried plugging in and unplugging multiple times, and it didn't crash. I doubt it'd work with my Thunderbolt display at work, but it worked fine for my HDMI displays at home. I even plugged it into my TV, and it stuck to the 100% scaling I picked for the othe

ERNOS: Erlang Networked Operating System

I've been reading Dreaming in Code lately, and I really like it. If you're not a dreamer, you may safely skip the rest of this post ;) In Chapter 10, "Engineers and Artists", Alan Kay, John Backus, and Jaron Lanier really got me thinking. I've also been thinking a lot about Minix 3 , Erlang , and the original Lisp machine . The ideas are beginning to synthesize into something cohesive--more than just the sum of their parts. Now, I'm sure that many of these ideas have already been envisioned within Tunes.org , LLVM , Microsoft's Singularity project, or in some other place that I haven't managed to discover or fully read, but I'm going to blog them anyway. Rather than wax philosophical, let me just dump out some ideas: Start with Minix 3. It's a new microkernel, and it's meant for real use, unlike the original Minix. "This new OS is extremely small, with the part that runs in kernel mode under 4000 lines of executable code.&quo

Drawing Sierpinski's Triangle in Minecraft Using Python

In his keynote at PyCon, Eben Upton, the Executive Director of the Rasberry Pi Foundation, mentioned that not only has Minecraft been ported to the Rasberry Pi, but you can even control it with Python . Since four of my kids are avid Minecraft fans, I figured this might be a good time to teach them to program using Python. So I started yesterday with the goal of programming something cool for Minecraft and then showing it off at the San Francisco Python Meetup in the evening. The first problem that I faced was that I didn't have a Rasberry Pi. You can't hack Minecraft by just installing the Minecraft client. Speaking of which, I didn't have the Minecraft client installed either ;) My kids always play it on their Nexus 7s. I found an open source Minecraft server called Bukkit that "provides the means to extend the popular Minecraft multiplayer server." Then I found a plugin called RaspberryJuice that implements a subset of the Minecraft Pi modding API for B