Skip to content

Instantly share code, notes, and snippets.

@philipn
Last active October 20, 2022 02:37
Show Gist options
  • Save philipn/5274197 to your computer and use it in GitHub Desktop.
Save philipn/5274197 to your computer and use it in GitHub Desktop.
Running Ubuntu on a Macbook Air

Running Ubuntu on a Macbook Air

You don't have to be a slave to OS X! Here's a guide to a sane dual-booting setup with Ubuntu 12.10 on your shiny MacBook Air. This is written and tested for a MacBook Air 5,2 (Mid 2012), but likely works the same with any modern Macbook.

Install according to instructions at this URL:

http://www.maketecheasier.com/install-dual-boot-ubuntu-in-macbook-air/2012/08/27

But use this ISO, for 12.10, instead:

http://releases.ubuntu.com/quantal/ubuntu-12.10-desktop-amd64+mac.iso

Once you hit Step 6 ("Post Install") stop reading and come back here. Don't do their post install steps -- they are outdated.

Mouse note

Oh hey, now you're in Linux. Your mouse is going to act a little funky until we have everything set up right. One thing you'll want to know:

  • Right-click: Click the trackpad with two fingers.
  • Middle-click: Click the trackpad with three fingers. Middle clicking is how some types of copy/pasting work in Linux.

Fix wifi

On reboot, apt-get update, apt-get upgrade. This will break your wifi, but then go into: System->Software Sources->additional sources and disable the wifi module and things will work again after reboot.

Also, run this:

echo "brcmsmac" >> /etc/modules

Configure keys

Configure control / meta key positions - configure this to your liking:

Go into System -> Preferences -> Keyboard

Click on the "Layouts" tab and then click the "Layout Options" button.

Click on "Alt/Win key behavior"

Select "Control is mapped to Win keys (and the usual ctrl key).

Fix trackpad (kind of)

Fix trackpad madness. Unfortunately, there's not a 100% perfect solution right now, but here's what I recommend for the time being:

So, things are kind of messed up in the multitouch trackpad world right now. The default driver that ships with Ubuntu is the synaptics driver, and it actually works really, really well -- it's smooth, setting up gestures using something like touchegg works great, etc. BUT! For some reason it doesn't support thumb detection, so it's incredibly cumbersome to use a mac with one of those big no-button trackpads (e.g. all current macs). This is because almost everyone rests their thumb on the trackpad as they mouse around.

Eventually someone will add thumb detection support into synaptics and the world will be perfect. But until then, here's what I recommend:

Compile and install the mtrack driver as follows:

git clone https://github.com/BlueDragonX/xf86-input-mtrack.git
libtoolize
aclocal
autoconf
automake --add-missing --copy
./configure --with-xorg-module-dir=/usr/lib/xorg/modules/
sudo make install

Then edit /etc/X11/xorg.conf (create file) and add:

Section "InputClass"
     MatchIsTouchpad "on"
     Identifier      "Touchpads"
     Driver          "mtrack"
     Option          "Sensitivity" "0.55"
     Option          "FingerHigh" "12"
     Option          "FingerLow" "1"
     Option          "IgnoreThumb" "true"
     Option          "IgnorePalm" "true"
     Option          "TapButton1" "0"
     Option          "TapButton2" "0"
     Option          "TapButton3" "0"
     Option          "TapButton4" "0"
     Option          "ButtonMoveEmulate" "false"
     Option          "ButtonIntegrated" "true"
     Option          "ClickTime" "25"
     Option          "BottomEdge" "30"
     Option          "SwipeLeftButton" "8"
     Option          "SwipeRightButton" "9"
     Option          "SwipeUpButton" "0"
     Option          "SwipeDownButton" "0"
     Option          "ScrollDistance" "75"
EndSection

This disables tap-to-click and sets up the bottom 30% of the clickpad to not register new touches. You may want to play with these settings.

Set up natural scrolling

Natural scrolling (if you're into that kind of thing). Create .Xmodmap in ~/ with the following:

pointer = 1 2 3 5 4 7 6 8 9 10 11 12

Get all those fannncy microsoft fonts

To make the web stop looking shitty:

sudo apt-get install msttcorefonts

Fix font hinting/antialiasing

Let's make fonts look more like they do on OS X:

sudo apt-get install gnome-tweak-tool

Open gnome-tweak-tool and go into Fonts and turn off hinting. Set Antialiasing to Rgba. Some applicaitons use this thing called fontconfig to get some settings, rather than get their settings from Gnome. Let's kill the fontconfig settings so things will just default to Gnome's config -- this lets Firefox render fonts correctly:

sudo rm /etc/fonts/conf.d/10-*

Set up gestures

Set up snazzy gestures:

(note: will come back to this - not working yet w/ the mtrack driver)

@csta
Copy link

csta commented Sep 19, 2013

Also works fairly well on MacBook Air 4,2 with Ubuntu 13.04. Thanks!!

@bengl
Copy link

bengl commented Nov 6, 2013

On 13.10, you can install mtrack with apt-get: sudo apt-get install xserver-xorg-input-mtrack. Works just fine for me with the settings here. No more problems with over-sensitivity, yay! Thanks for these instructions!

@aroman
Copy link

aroman commented Mar 1, 2014

this is a great resource, thanks!

@oldfeel
Copy link

oldfeel commented Aug 20, 2015

thank you, you saved my computer

@phackwer
Copy link

I've installed mtrack too, but used it with default values. And I'm using a visual tool for setting up somethings.

Things I'm still missing: draging with three fingers, and 4 fingers moves.

Try this:

sudo apt-get install gsynaptics
gpointing-device-settings

@edib
Copy link

edib commented Jan 30, 2016

mtrack with default settings disabled all nice feautures like double click right menu and right menu at all. So I just have added below lines and commented the single line. It just like my previous pc notebook touchpad and bottom right click becomes right click.

Section "InputClass"
Identifier "Disable clickpad buttons on Apple touchpads"
MatchProduct "Apple|bcm5974"
MatchDriver "synaptics"
# Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection

@bitjockey42
Copy link

bitjockey42 commented Apr 24, 2016

The mtrack driver is now being maintained by p2rkw here.

git clone https://github.com/p2rkw/xf86-input-mtrack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment