Xmonad/Using xmonad on Apple OSX
xmonad runs well on Apple OSX machines, and needs little work to be useful. This page collects advice and information on using xmonad successfully with OSX.
If you're using xmonad on a mac, add details about your configuration here!
1 Configuring Your .xinitrc to Run XMonad
- Build and install XMonad like you would any other Haskell library.
- do the following on the Terminal:
$ cp /private/etc/X11/xinit/xinitrc ~/.xinitrc $ chmod +w ~/.xinitrc $ vim ~/.xinitrc #comment out the line 'exec quartz-wm' and add PATH-TO-XMONAD/xmonad after it.
- You may want to add
quartz-wm --only-proxy &to your xinitrc, which synchronizes X11/OSX clipboards.
- Open X11. XMonad should be running now.
2 Configuring Xmonad for OS X
- You probably don't have a numlock key. Set numlockMask to 0. (The default is mod2Mask, which happens to be Apple's default for the command key.)
- You may use the defaultGaps to make xmonad not clash with the dock. As the dock size is configurable and may vary depending on the number of icons in the dock you will have to measure your dock yourself. Before 0.7 defaultGaps are in xmonad, since 0.7 these should be in xmonad-contrib.
3 Full screen mode
I highly recommend running X11 in full-screen mode. To enable this, open the Preferences dialog for the X11 app, check the checkbox, and restart X11. This way, you don't have to worry about stupid things like the dock / menubar / OS X apps getting in your way.
4 Does Not Replace Quartz, Silly
You won't be able to use xmonad to manage normal OS X apps. X11 will just be another OS X sitting in your dock that you can switch to. However, it is pretty easy to install a decent set of X11 apps. If you have MacPorts installed you can install the packages firefox-x11, rxvt-unicode, unclutter, and 'vim +gtk2' (the +gtk2 variant for PRIMARY/CLIPBOARD support) to get started.
5 Fitting Other Bits For Use With xmonad on OS X
dmenu can be built on OS X without problems but it is invisible unless you run X11 in full-screen. Unlike xmonad it does not detect the OS X top menu bar and is completely hidden by it. You can also make it display at the bottom (behind the dock :).
Since I do not know how to detect the top menubar either I just patched dmenu to add support for gaps. Unfortunately the dmenu authors do not seem very responsive so I attach the patch here.
You can then run
dmenu -g 22 to work around the OS X top menu.
6 Potential Configuration Problems
You may have problems with configuring XMonad under OSX - if you see the "error detected while loading xmonad configuration" error message but with no error output, it could be because the PATH inherited by XMonad doesn't include ghc (eg by default it won't include /usr/local/bin).
- Or just hardwire the path into xmonad itself - change "ghc" -> "/usr/local/bin/ghc" (or whatever) in Core.hs before building XMonad.