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

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 Bukkit s…

Apple: iPad and Emacs

Someone asked my boss's buddy Art Medlar if he was going to buy an iPad. He said, "I figure as soon as it runs Emacs, that will be the sign to buy." I think he was just trying to be funny, but his statement is actually fairly profound.

It's well known that submitting iPhone and iPad applications for sale on Apple's store is a huge pain--even if they're free and open source. Apple is acting as a gatekeeper for what is and isn't allowed on your device. I heard that Apple would never allow a scripting language to be installed on your iPad because it would allow end users to run code that they hadn't verified. (I don't have a reference for this, but if you do, please post it below.) Emacs is mostly written in Emacs Lisp. Per Apple's policy, I don't think it'll ever be possible to run Emacs on the iPad.

Emacs was written by Richard Stallman, and it practically defines the Free Software movement (in a manner of speaking at least). Stal…

JavaScript: Porting from react-css-modules to babel-plugin-react-css-modules (with Less)

I recently found a bug in react-css-modules that prevented me from upgrading react-mobx which prevented us from upgrading to React 16. Then, I found out that react-css-modules is "no longer actively maintained". Hence, whether I wanted to or not, I was kind of forced into moving from react-css-modules to babel-plugin-react-css-modules. Doing the port is mostly straightforward. Once I switched libraries, the rest of the port was basically:
Get ESLint to pass now that react-css-modules is no longer available.Get babel-plugin-react-css-modules working with Less.Get my Karma tests to at least build.Get the Karma tests to pass.Test things thoroughly.Fight off merge conflicts from the rest of engineering every 10 minutes ;) There were a few things that resulted in difficult code changes. That's what the rest of this blog post is about. I don't think you can fix all of these things ahead of time. Just read through them and keep them in mind as you follow the approach above.…