This is my current configuration for the XMonad window manager. I run XMonad without a desktop environment.
This configuration includes:
- My custom "Terminal" layout, which sizes xterms to 80 columns.
- Support for two monitors with separate xmobars.
- Cutesy layout icons in place of names.
- Volume and backlight controls.
Link either the desktop or laptop (or a completely different) xmobar configuration into place:
ln -s xmobarrc-desktop xmobarrc.0
Ensure that Stack is in your PATH
.
Clone this repo as ~/.xmonad
.
In ~/.xmonad
, run:
stack setup
stack build
stack install xmonad
stack install xmobar
This will install an xmonad
binary in ~/.local/bin
. Ensure this directory
is in your PATH
.
Arrange for your X startup to run ~/.local/bin/xmonad
. In my case, I added an
.xsession
file my homedir with the contents:
#!/bin/sh
exec ~/.local/bin/xmonad
If you are using LightDM, the trick to getting it to run ~/.xsession
is to
create an xsession desktop entry with the binary specified as default
. This is
hardcoded to trigger magic behavior, and is poorly documented, so I'm reminding
myself here.
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=User .xsession
Exec=default
Terminal=false
It is important not to run your window manager using stack exec
, because
this will cause all processes in your session to inherit stack's local
environment (GHC location, etc.), possibly breaking other Haskell development.
Once you've gone through all this once, the file ~/.xmonad/build
ensures that
recompilation happens correctly.