Skip to content

Instantly share code, notes, and snippets.

@jbeard4
Forked from danchoi/xmonad-lion.md
Last active December 19, 2015 04:38
Show Gist options
  • Save jbeard4/5898283 to your computer and use it in GitHub Desktop.
Save jbeard4/5898283 to your computer and use it in GitHub Desktop.

My Xmonad recipe for OS X Lion

My recipe for setting up Xmonad on Ubuntu GNU/Linux is here.

What is xmonad? Read this page to learn.

Some of these instructions were adapted from the Source Matters Blog. But I also depart from those instructions in certain ways.

First, download XQuartz. It's a replacement for the stock X11 utility that seems to work better with xmonad as far as TrueType fonts and keymappings are concerned.

Start up XQuartz, open Preferences.

  • Under the Input tab, enable "Enable three button mouse" and "Option keys send Alt_L and Alt_R."
  • Under the Output tab, set Colors to "millions". Don't select Full-Screen mode.
  • Under the Pasteboard tab, enable all options.
  • Under the Windows tab, I like choosing "Focus Follows Mouse."

Quit XQuartz.

For the following steps, you will need Homebrew. I'll assume you have it already.

Next brew install ghc haskell-platform if you don't already have Haskell.

Next, install xmonad with cabal install xmonad.

Create an ~/.xinitrc file. This will be read when you start XQuartz & launch xmonad immediately.

[[ -f ~/.Xresources ]] && xrdb -load ~/.Xresources
cd $HOME
xterm &
$HOME/.cabal/bin/xmonad

Create a ~/.Xdefaults file. Put this in it:

xterm*Background:               black
xterm*Foreground:               green
xterm*cursorColor:              purple
xterm*pointerShape:             arrow
xterm*pointerColor:             red
xterm*faceName: Monaco
xterm*faceSize: 9
xterm*loginShell: true

The last line configures xterm to be a login shell, which means it will behave consistently with iTerm.app. This will allow OS X console applications such as Homebrew to work correctly with xterm.

Now restart XQuartz. You should be in xmonad. Press ALT+SHIFT+ENTER to open new window tiles. If xmonad seems unresponsive at first, click on the first xterm window to start capturing keyboard input.

You can change the colors, pointer, fontName and faceSize in .Xdefaults. To see what fonts you can choose from use this command: fc-list | less.

To paste the contents of the pasteboard into an xmonad terminal, hold down OPTION and click the mouse/trackpad button.

To change font sizes for a particular window, you can use the popup xterm font menu, invoked with CTRL+COMMAND+click.

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