[xmonad] Config File Format

Devin Mullins me at twifkak.com
Sun May 11 15:46:18 EDT 2008

Hi all (long time no see),

There's been chatter about a *shudder* GUI configurator, primarily
because people are having trouble with xmonad.hs. Observing some of the
syntax troubles people are having, I think there are some easy wins we
can make with xmonad.hs, before resorting to GUI.

Mainly, the problem seems to be with irregularity. Oh, you want to say
layoutHook = layoutHook defaultConf ||| simpleTabbed. No, not layoutHook
= layoutHook defaultConf ||| smartBorders. No, withUrgencyHook doesn't
go inside the record syntax. Yes, a dollar sign goes there; don't ask me

Back when I existed last fall, sjanssen mentioned FRefs. I think that's
a Very Good idea. Imagine, if you will:

main = xmonad $ defaultConfig
    <:> modMask <=> mod4Mask
    <:> terminal <=> "urxvt"
    <:> layout <+> simpleTabbed
    <:> layoutHook <+> smartBorders
    <:> keys <-> "M-b"
    <:> global <+> withUrgencyHook dzenUrgencyHook ["-bg", "darkgreen"]

How easy would that be to document? "Just add a line saying, <blah>
after your 'main =' line." The only remaining oddnesses are:
  1. the ordering importance with layout and layoutHook. (If people are
     willing to reseparate layout and layoutHook, that goes away.)
  2. ultra-global functions like dzen and xmobar. Perhaps do something
       main = xmonad =<< return defaultConfig -- could sugar this
     and then
       <:> ultraGlobal <+> dzen -- needs a better name
     could spawnPipe.

(I'm not sure what to do about the keys/modMask relationship. One answer
is to let the user say:
  <:> keys <-> (modMask, "b")
And let keys take care of the magic. This means defining "FRefs" for
mod1Mask, controlMask, (.|.), etc. Kinda hackish.)

All this by means of saying: I'm thinking of adding this to EZConfig,
but if there's stronger interest in this, I won't, and we can make the
change to core (to prevent confusion). Perhaps EZConfig is the best way,
though. Let it settle in and see whether it's actually useful for newbs.

P.S. - I mean, if we're going to get My Mom configuring xmonad, we'll
need a GUI. Then again, My Mom will probably never configure anything.
Oh yeah, and I still haven't convinced her to switch to a Mac, despite
telling her that her computer will stop crashing and slowing to a crawl
if she does. XMonad is not for Moms (a certain xkcd series excepted);
it's for people who want to learn something about their system (i.e.
Arch users :).

More information about the xmonad mailing list