dwm on Mac OS X (for Snow Leopard)

The good news are that is possible to run the best WM on OS X with no hassle. This is true thanks to the fact that OS X comes with a fully functional X11 implementation. You can find it on Applications/Utilities/X11.

(The next instructions were only tested on Snow Leopard but they should be valid also for other versions)

Screenshot of dwm on OS X

Features

You will not be able to use dwm to manage normal OS X apps. X11 will just be another OS X application sitting in your dock that you can switch to. So dwm just will be able to control the windows that are on X11. Apart from that, it will be behave perfectly giving a good experience because it will work in full-screen mode hiding everything else.

Steps to get it to work

  1. The only prerequisite is to install Xcode from Apple in order to get the development tools including the Xlib headers.

  2. Get the tarballs of dwm and dmenu from suckless. Configure, compile and install those programs in the standard way. Two hints for the configuration:

  3. The keyboard layout must be customized with $HOME/.Xmodmap in order to activate some important keys. Copy the next lines to the cited file:

    clear Mod1
    clear Mod2
    keycode 63 = Mode_switch
    keycode 66 = Meta_L
    add Mod1 = Meta_L
    add Mod2 = Mode_switch
    
  4. Create a $HOME/.xinitrc script to start the WM. The $PATH must be fixed because its content it is not correctly preserved. Use these lines for the script:

    export PATH=/usr/local/bin:$PATH
    cd $HOME
    xmodmap .Xmodmap
    while true; do
        xsetroot -name "`date` `uptime | sed 's/.*,//'`"
        sleep 1
    done &
    exec dwm
    
  5. Set up the next options in the preferences of X11:

The UNIX way on OS X

Apart from the Xcode development tools and the minimalist WM dwm there are lots of UNIX tools that simply work on OS X. Look in:

List of suckless apps (cool & lightweight) that rocks on OS X:

I also prefer Opera to Safari. As expected, there is a fair play between Linux and OS X with NFS, CUPS, SSH and X11.

Trick: In order to connect to a Linux NFS file server use the insecure flag (see manpage of exports(5)).

See also

The next link give plenty of good hints in order to set up dwm on OS X.

Last modified date: Wed May 5 21:44:58 CEST 2010