Arch Linux on a MacBook Pro 9.2
So my grad school gave me a free MacBook Pro 9.2, but I am a die-hard Linux fanboy. I thus gathered information and installed Arch on a MacBook:
Some boot keycodes
- Hold alt while booting to display the startup manager (you can select your boot device here).
- Hold ctrl while selecting a boot device (choose your EFI partition) to permanently boot from that one.
- Hold cmd+R while starting to start a recovery. If you have a OS X recovery partition, this is a recovery wizard (restore from time machine, reinstall OS X, disk utility). If you don’t, it starts a complete internet recovery ((almost?) restore factory defaults). It even restores your EFI NVRAM thingy, I think.
Some Mac OS X things
Eduroam
Download from here the files lrz.eduroam.profil.mobileconfig and lrz.vpn.profile.mobileconfig. Doubleclick them in OS X and enter your password a few times.
Arch Linux (dual boot with OS X) on a MacBook Pro 9.2
These two guides are gold, and in the following, I just highly summarized the procedure from here:
- [https://wiki.archlinux.org/index.php/MacBook_Pro_9,2(Mid-2012)](https://wiki.archlinux.org/index.php/MacBook_Pro_9,2(Mid-2012))
- https://wiki.archlinux.org/index.php/MacBook
Also, the (long) Beginner’s guide and (condensed) Installation guide are awesome:
- https://wiki.archlinux.org/index.php/Beginners%27_Guide
- https://wiki.archlinux.org/index.php/Installation_Guide
Preparation
- From within OS X, Shrink your OS X partition to like 100GB.
- Don’t install rEFInd yet. I’d do that from within Arch later.
- Get a ‘‘wired’’ internet connection.
The normal Arch installation
Boot into Arch (USB stick), run cgdisk. Delete the OS X recovery partition, if you like. (leave the EFI partition intact!) Then create your Arch partition(s), set it to type “Linux”. Then:
Reboot. Without ‘‘alt’’ pressed, OS X will boot. With ‘‘alt’’ pressed, you can change your startup partition. To permanently change to another partition, hold ‘‘ctrl’’ while selecting one from this menu.
Post-installation
To make Arch instad of Mac the first entry in rEFInd
In /boot/efi/EFI/boot/refind.conf
, set default_selection to 2. Also, you can set timeout to 3.
User
Install the necessary packages
Xorg
Make your ‘’’~/.bash_profile’’’ this:
Your ‘’’~/.xinitrc’’’:
Apple keyboard and trackpad
To make F1-F12 keys work permanently without pressing Fn, put this in /etc/modprobe.d/hid_apple.conf
:
(For a temporary change or when it sometimes just doesn’t work after booting, echo 2 > /sys/module/hid_apple/parameters/fnmode
)
Create /etc/X11/xorg.conf.d/10-keyboard.conf
:
To disable the annoying accidental tap clicks, in /etc/X11/xorg.conf.d/50-synaptics.conf
, comment out the three “TapButton” lines:
Best to reboot now and log in as user (starting LXDE).
If umlauts are weird dead keys in xterm (but not in Firefox), re-check your locale.gen and .conf, and generate them, reboot. I did the “turning it off and on again” and it worked then. Weird.
Further info:
Wireless
Install b43-firmware
from the AUR. (Necessary commands: makepkg -s
and pacman -U
)
Openbox config
In ~/.config/openbox/lxde-rc.xml
, add these lines for Ctrl-Alt-T to open a terminal and Ctrl-Alt-F to open a file manager:
Install your user software
Install dropbox from the AUR. Set it up. Afterwards, delete ~/.config/autostart/dropbox.desktop
(because you already put a delayed start call in your ~/.xinitrc). TODO: This autostart file gets restored automatically. Why?
Now, pacman -S
the following packages:
- arandr
- auctex
- cups
- cups-filters
- emacs
- evince
- flashplugin
- filezilla
- gcc
- gcc-fortran
- gimp
- glhack (or AUR’s nethack-x11[-patch] if it tickles your fancy)
- jre7-openjdk
- lame
- leafpad
- libreoffice
- nfs-utils
- openssh
- r
- subversion
- tcl
- terminator
- texlive-bin
- texlive-core
- texlive-fontsextra
- texlive-latexextra
- thunderbird
- tk
- unrar
- unzip
- wget
- zip
Install emacs-ess from the AUR.
Configure your software
Your ~/.emacs
(this is probably only relevant for me. I saved a shared config file for all my computers on Dropbox):
Add icons in your Openbox quickstart bar:
- Firefox
- Emacs
- Lxterminal (but remember the shortcut Ctrl-Alt-T)
For thunderbird, you have to create a manual entry (TODO/auto-appeared after a thousand reboots).
Set your email accounts in thunderbird.
Firefox plugins:
- AdBlock Plus
- HTTPS Everywhere
- Reddit Enhancement Suite
For dual monitors, get a display port adapter and start arandr, the GUI for xrandr.
Eduroam in NetworkManager
Following this guide (Use TTLS/PAP): http://www.lrz.de/services/netz/mobil/802_1x/802_1x-linux-ubuntu/
- General
- Automatically connect to this thing
- Wi-Fi
- SSID: eduroam
- MTU: automatic
- Wi-Fi Security
- Sec: WPA&WPA2 Enterprise
- Auth: Tunneled TLS
- Anon: anonymous@mwn.de
- Cert: /etc/ssl/certs/Deutsche_Telekom_Root_CA_2.pem
- Inner: PAP
- User: [me]@campus.lmu.de
- Enter the password
Because of some bug, you have to enter the password manually every time for now. It’s weird. A solution is described here. Summary: Edit your /etc/NetworkManager/system-connections/eduroam\ TTLS
file’s [802-1x] section. Delete the line password-flags=1
Printing
- Install cups and hplip (for HP printers)
- Do
systemctl enable cups.service
from the console and restart (or dosystemctl start cups.service
additionally instead). - Browse to http://localhost:631/ and add printers manually (enter IP etc.), otherwise you might print to random printers in your network.
Wacom tablet
- Do:
sudo pacman -S xf86-input-wacom
- Plug in the USB tablet
- Restart X so it recognizes it
- Do:
xsetwacom --list devices
- To display all possible options:
xsetwacom --get "Wacom Graphire2 4x5 stylus" all
- oreraser/cursor
instead ofstylus
- Relative cursor position (put these in a shell script):
xsetwacom --set "Wacom Graphire2 4x5 stylus" Mode Relative
xsetwacom --set "Wacom Graphire2 4x5 eraser" Mode Relative
- Arch wiki: Wacom, it has info on how to automate that.
For cursor speed see here:
xinput list
, Write down the IDs of your devices (e.g. 16)xinput watch-props 11
, Write down ID of Device Accel Constant Deceleration (e.g. 270)
Then, change deceleration from 1 to 2.5: (for each input device)
xinput set-prop 16 270 2.5
Two screens
Install ‘arandr’ and click together a layout. Save the shellscript and put it in ~/bin/2screens.sh or whatever.
Misc things and issues
To disable the trackpad when a mouse is plugged in and avoid accidental weird emacs scrolls / copy-pastes (from here):
Emacs-color-theme
emacs-color-theme requires xorg-fonts-100dpi, which screws up firefox fonts also. Do this to fix: