xmonad is a tiling window manager for X11. This document describes how to build and install xmonad. For its features and use, see the guided tour.
Your operating system distribution may have binary packages for xmonad already, or perhaps, many of their dependencies. If at all possible, use one of these pre-built packages. See the main page for distributions that distribute xmonad binaries.
Building xmonad from source is simple. It requires a basic Haskell toolchain, only. We’ll now walk through the complete list of toolchain dependencies.
To build xmonad, you need the GHC Haskell compiler installed. All common operating systems provide prebuilt binaries of GHC in their package systems. For example, in Debian you would install GHC with:
$ apt-get install ghc
If your operating system’s package system doesn’t provide a binary version of GHC, you can find pre-built binaries at the GHC home page. It shouldn’t be necessary to compile GHC from source – every common system has a pre-build binary version.
We recommend the latest stable release of GHC.
Since you’re building an X application, you’ll need the C X11 library headers. On many platforms, these come pre-installed. For others, such as Debian, you can get them from your package manager:
$ apt-get install libx11-dev
Typically you need the C libraries: libXinerama libXext libX11
Recent versions of Cabal provide a tool, cabal-install, which automates the building of Haskell libraries, including gathering all dependencies. Your distribution may have a binary package for cabal-install, in which case you should use that. Otherwise the following steps will install it:
Run the bootstrap script to install cabal-install with all of it’s dependencies into your home directory.
$ tar xzf cabal-install-220.127.116.11.tar.gz $ cd cabal-install-18.104.22.168/ $ ./bootstrap.sh
$ echo "export PATH=$PATH:~/.cabal/bin" >> ~/.profile
Once you have a working cabal-install, you can then simply install any Haskell package you find on hackage.haskell.org, such as xmonad, xmonad-contrib or xmobar:
$ cabal install xmonad
xmonad-contrib requires you to install libxft C headers, unless you install it without xft support:
$ cabal install xmonad-contrib --flags="-use_xft"
From time to time people have build problems. Almost always this is due to missing dependencies. Sometimes it is due to problems with the tool chain. The most common problems building xmonad are documented in the FAQ:
If this doesn’t help, try asking on the IRC channel, #xmonad @ freenode.org, or on the mailing list.
Extra programs that make life with xmonad more exciting: dmenu and dzen. dmenu provides a simple popup menu for launching programs, dzen provides customisable status bars. You can get them here:
The simplest way to start xmonad is to modify your .xsession or .xinitrc and add the line:
as the last line of your file, commenting out any previous window manager. Now, when you log in to X, xmonad will start, (by default in tall tiling mode, with no status bar), and you’ll be presented with an empty screen: