This repository contains my XMonad [] configuration. I thought I'd share it with the rest of the world because I'm doing a few interesting things:
-
I use
cabal
sandboxes to build XMonad and compile my configuration into an executable (xmonadrc
). This means I don't have to rely on packages from my operating system vendor and I also don't have to install any packages in~/.cabal
, which I'm likely to delete at some point when I get into cabal hell.This presents an interesting challenge since XMonad by default tries to compile your
~/.xmonad/xmonad.hs
file when it starts. Therefore I install my generatedxmonadrc
binary where XMonad expects it and use.cabal-sandbox/bin/xmonad
to restart the running XMonad. I've also updated my~/.xinitrc
to exec myxmonadrc
directly without using thexmonad
binary.All the details for this process are in the
GNUmakefile
. -
The
checkrc
executable that is built withcabal
boots a mini XMoand environment in order to test my configuration before restarting XMonad. Right now it's only testing the key bindings. -
The majority of my key bindings are underneath a prefix key:
C-z
. Being a long time user of tools like GNU screen, tmux, and Emacs, I've become very accustomed to prefix keys. I quite like them.
-
xmonadrc.hs
: This is where themain
function lives. -
src/XMonad/Local/Action.hs
: Event handling. I have an interesting function in there calledfocusFollowsTiledOnly
that enables focus-follows-mouse in the tiled layer but not in the floating layer. I found that:focus-follows-mouse + update-pointer + floating-windows = weird-stuff
-
src/XMonad/Local/Keys.hs
: All of my key bindings, grouped by functionality. -
src/XMonad/Local/Layout.hs
: Layout rules. -
src/XMonad/Local/Log.hs
: Log hook, window fading, writing XMonad status information to xmobar. -
src/XMonad/Local/Music.hs
: Functions to switch radio stations and select albums to play in MPD. -
src/XMonad/Local/Prompt.hs
: XPrompt configuration. -
src/XMonad/Local/Workspaces.hs
: The names of my workspaces plus some functions that decide if the workspace name should show up in xmobar and to convert workspace names into key bindings.
If you are interested in using cabal
to build your XMonad
configuration then you might also be interested in the following
outline of the steps I take to build, install, and restart XMonad.
-
Install the Haskell Platform [].
-
Install
cabal-install >= 0.18
:$ cabal update $ cabal install cabal-install
-
Use the
GNUmakefile
andxmonadrc.cabal
files in this directory to build your XMonad configuration.$ make
-
Install and restart XMonad (assumes XMonad is currently running):
$ make restart
The details about how this works are in the GNUmakefile
(correctly
naming the xmonad executable, installing, restarting) and
xmonadrc.cabal
(which source files are included, build dependencies,
etc.)