Setting Up an OS X Mac with The Usual Suspects

This page has changed quite a bit since I first created it however many moons ago. You can find an older version of it devoted to Tiger, which emphasizes EMACS and the i-Installer approach to getting LaTex, here.

I used to use two mostly-identical Macs runing OS X, one at the home and one on the office. Now that laptop hard drives have become so large, I've switched to doing everyone on my laptop and hooking it to big screens when I'm at home or at the office.

I put this page together to share my experience in getting my Mac into the shape I like; hopefully it save some other folks some time. Here you will findome notes to help make your OS X machine lean and mean (well, not so lean, but definitely mean). Anytime I need to set up a new Mac, I run through the notes on this page to make sure I've covered everything.

Leopard

Upgrading to Leopard is well worth it. (Remember something nice that appeared in Jaguar: The Expose navigation tool is particularly nice; hit F9, F10, or F11 to bring different things quickly in and out of view). Make frequent use of the automatic update checker, available by clicking on "Software Update" in the System Preferences.

Alas, the dock has turned into a confusing pseudo-3D mess, and the little black arrows that used to indicated what applications are running have turned into little glowing orbs that are difficult to see against the reflective dock. A couple of lines from an arstechnica column restores it to sanity:

% defaults write com.apple.dock no-glass -boolean YES
% killall Dock

I recommend installing the Xcode developer's tools, available on the Leopard install disk. Even if you never do any programming yourself, sometimes various package installers will want to use its facilities.

OS X's GUI has become rather bloated with superfluous animation. I recommend going into the Dock settings in the System Preferences and setting the "Minimizing using" to "Scale Effect" and turning off "Animate opening applications."

Some Tricks

Note that in OS X you can type "open filename" at the command line, and it will open the file with whatever the default program is. So while on a unix system you might type "acroread paper.pdf," in OS X you will type "open paper.pdf"

This "open" command is pretty flexible. It basically simulates a double-click. If you give it a folder or application, it will open that folder or application. "open -a application file" opens a file in the specified application, and "open http://website" opens a website in the default browser. "open -e file" will open the file in TextEdit.

Be sure to "show status bar" (under "View") in Safari.

X Windows

In the early days, if you wanted X Windows, you had to use something called OroborOSX. Apple now has its own X11 that starts up and draws a lot faster, which comes with Leopard. It doesn't install automatically when you install Leopard; you need to get it from "Optional Installs" package on the Leopard install disk. To get X11 to start automatically, go to the "Accounts" panel in the System Preferences." Click on your account, and drag X11 into the "Startup Items."

Note: The rest of the information in this section is old. I now login to remote shells via the "New Remote Connection..." feature of the Terminal.

You can put custom commands in the Applications menu in Apple's X11. I like to customize Terminal (in the X11 menu, not Apple's Terminal program) like this:

xterm -sl 1000 -sb -rightbar

I also like to set up custom commands to log into different machines, for instance, a Bigzilla command which executes

xterm -sl 1000 -sb rightbar -title bigzilla -e ssh bigzilla.ece.gatech.edu

You can edit the customizations directly by modifying the text file

/Users/lanterma/Library/Preferences/com.apple.x11.plist

(Clicking on the above link will show you my X11 customization file.)

Emacs

Those of you who like Emacs (which includes me if I don't have TextMate available) may find this section useful. I haven't updated it since I upgraded to Leopard, so reader beware - what is given in the rest of this section may no longer be valid.

I used to use a Carbon version of Emacs by Mindlube from mindlube.com/products/emacs/index.html. I've since switched to Aquamacs, which is much much much nicer - it adds a lot of Mac interface conventions on top of Emacs.

It is set up as an OS X Application, meaning you can just double-click on it. The menus show up along the very top of the screen as in a usual Mac application. I like putting Emacs in the Application folder and also dragging it to the Dock for fast access.

The Emacs that comes standard with Mac OS X is a non-fancy version that doesn't know about mice and other such things. To be able to run the fancy Jaguar version you downloaded from the command line, you need to do something like the following from a Terminal or xterm:

cd /usr/bin % find the standard boring Emacs
sudo mv emacs emacs_old % move it elsewhere

and make a new file called "emacs" (also need to use sudo to be able to edit files in /usr/bin, i.e. "sudo vi emacs") containing:

#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$@"

Then do

sudo chmod a+x emacs

so it's runnable as a script.

Now when you type Emacs from the command line, it brings up the cool Panther version of Emacs.

Aaron's .emacs File

As an aside, I've found it useful to have this .emacs file in my home directory:

(setq auto-mode-alist
(cons '("\\.tex\\'" . latex-mode) auto-mode-alist))

(define-key esc-map "G" 'goto-line)

You can type Escape, capital-G, and then a line number to quickly go to a specific line. Also, putting in this line will make it automatically put different syntatic features in different colors for LaTex, C, HTML, whatever...

(global-font-lock-mode 1) -->

Useful Programs

If You're Georgia Tech Faculty...

We've got site licenses for Microsoft Office 2004, Matlab, Mathematica, and LabView. Matlab and LabView are available from the ECS website; the others from the OIT website.

I was able to get the Matlab 7 to talk to the campus license server with no problem (I never could with the older versions of Matlab.)

Aaron's .bashrc file

Here's my .profile file (this is started by "login shells," such as the Terminal). My .bashrc file (started by "non-login shells," which includes xterms) just says "source .profile," since as if right now I don't need them to be different. Among other cool things, this causes directory listings to show up in color. (The color scheme doesn't work well against the black background, so I use the "Basic" Terminal window style. Another Terminal tip: Try turning on anti-aliasing, and setting your font to 12-point Monaco.) Note there's also a "clean" alias which lets you clean up the backup files that emacs makes, along with various temp files that LaTex creates.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
export EDITOR=/usr/bin/mate
export TERM=xterm-color
export CLICOLOR=true
export LSCOLORS=exfxcxdxbxegedabagacad

# source /sw/bin/init.sh

alias clean='rm -f *~ *# *.aux *.blg *.log *.dvi'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

#note you don't want to this script to
#delete the aux files; latex needs this available #on multiple passes! lt() {
if [ -e "$@".tex ]; then
latex "$@"
bibtex "$@"
latex "$@"
dvips -G0 -Ppdf -o "$@".ps "$@".dvi
rm -f "$@".dvi
ps2pdf "$@".ps
rm -f "$@".ps "$@".blg "$@".log
open "$@".pdf
else
echo "file does not exist"
fi
}