A Better Magic Trackpad Experience in Linux

If you’re like me, you own a nice Apple Magic Trackpad. You’ve also paired it with your Linux box and it’s working great. However, it could probably work better. The defaults for the device are, in my opinion, pretty unresponsive and at times really bizarre. Let’s walk through some hacks and fixes in order to get things working better.

First, there are two different ways of changing options for the trackpad. For now, we’ll default to using the command-line synclient tool in order to play around with values. Simply running synclient will list out all available options in additions to their present values. I like to back this file up before I make changes, so let’s do that now:

$ synclient |& tee ~/Downloads/synclient.backup

Great. Now, let’s get started by setting some values that really should be set by default. When using multiple monitors or even just really wide monitors, trackpad movement is horizontally extremely sensitive but vertically, it’s incredible insensitive. (Meanie.) For this hack, let’s make it permanent because it’ll make everything better anyway and doesn’t really come with too many risks. For some reason, we can’t test this with synclient, but the rest of the hacks, we’ll be able to test just fine from the commandline. Let’s create an Xorg configuration file for the device. Create a new file called /etc/X11/xorg.conf.d/60-apple-magic-trackpad.conf. Open it in your favorite editor and add the following:

Section "InputClass"
    Identifier "Apple Magic Trackpad"
    Driver "synaptics"
    
    MatchUSBID "05ac:030e"
    MatchIsTouchpad "on"

    Option "VertResolution" "75"
    Option "HorizResolution" "75"
EndSection

Unfortunately, you’ll need to restart X in order to see changes, so log out and log back in again and now you’ll see your cursor move much more intuitively in all directions.

Now, let’s get on to the fun stuff.

Fix right-click delay time

I’ve had an issue where, when two-finger clicking (ie: right-clicking), the mouse-up event would trigger too quickly and send a single click, thus instantly selecting the first item in a right-click menu. In my browser, when trying to copy text or to open a link in a new tab, it would automatically select the first item in the right-click mouse, which happened to be “Back” and would send me to the previous page. Not fun. Not fun at all. To fix this, we can tweak a synaptics property called EmulateMidButtonTime. To apply the fix temporarily, do the following:

$ synclient EmulateMidButtonTime=100

Experiment with different values to make sure that you’ve got something that works first, then we’ll add this as an option to the Xorg configuration file mentioned above. Simply add the following line underneath the other Option directives before EndSection:

Option "EmulateMidButtonTime" "100"

Increase Overall Sensitivity

There are many properties that control sensitivity, but for now, we’ll tweak the MinSpeed and the MaxSpeed synaptics properties to increase the sensitivity. First, set the MinSpeed to something higher than it is by default. On my machine, I have this set to 1.75. Set this temporarily using synclient like this:

$ synclient MinSpeed=1.75

Once you have MinSpeed at a value that you like, set MaxSpeed to a value a bit higher than MinSpeed to get the best experience.

$ synclient MaxSpeed=2.0

Finally, we’ll tweak another property that determines how fast the mouse speed will change between MinSpeed and MaxSpeed. Change this using the AccelFactor property:

$ synclient AccelFactor=0.1

Once you’re all set, add these as properties to your Xorg configuration file mentioned above:

Option "MinSpeed" "1.75"
Option "MaxSpeed" "2.0"
Option "AccelFactor" "0.1"

Increase/Flip Vertical and Horizontal Scroll Sensitivity

Tweaking the VertScrollDelta and HorizScrollDelta properties will control how fast you scroll. If you set these to negative values, you’ll also get what’s known as natural scrolling in OSX, or inverted scrolling. This will mean that as you drag two fingers up on the trackpad, you’ll scroll down, rather than up. In any case, the standard scrolling is too slow for me, so basically set these properties to positive values if you’re interested in increasing sensitivity without flipping axes:

$ synclient VertScrollDelta=-100
$ synclient HorizScrollDelta=-100

When you’re happy, again, just add these options to your Xorg configuration file before EndSection:

Option "VertScrollDelta" "-100"
Option "HorizScrollDelta" "-100"

Conclusion

In the end, my /etc/X11/xorg.conf.d/60-apple-magic-trackpad.conf file looks like this:

# Configuration for fine-tuning only the Apple Magic Trackpad.
Section "InputClass"
    Identifier "Apple Magic Trackpad"
    Driver "synaptics"

    # Match only the Apple Magic Trackpad
    MatchUSBID "05ac:030e"
    MatchIsTouchpad "on"

    # Set resolution tweaks for better response
    Option "VertResolution" "75"
    Option "HorizResolution" "75"

    # Set a timeout for multi finger click so accidental double-clicks don't
    # happen when right clicking and other gestures
    Option "EmulateMidButtonTime" "100"

    # Increase sensitivity
    Option "MinSpeed" "1.75"
    Option "MaxSpeed" "2.00"
    Option "AccelFactor" "0.1"

    # Scrolling   
    Option "VertScrollDelta" "-100"
    Option "HorizScrollDelta" "-100"
EndSection

Enjoy!

9 thoughts on “A Better Magic Trackpad Experience in Linux

  1. Pingback: TK Kocheran

  2. Nice stuff!
    Do you have any tips on tuning up an Apple Magic Mouse in linux? I’ve got mine working, but the ballistics are pretty horrible out of the box.

  3. I see a lot of interesting content on your blog. You have to spend a lot
    of time writing, i know how to save you a lot of work, there is
    a tool that creates unique, google friendly posts in couple of minutes, just search in google – k2 unlimited content

  4. for the middle click add this in your file
    #middle clic on linux
    #synclient TapButton3=2 ClickFinger3=2
    Option “TapButton3″ “2″
    Option “ClickFinger” “2″

    thanks for your help you have saved my time :)

  5. Pingback: magic trackpad avec debian wheezy | Linux et Geekeries

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>