[xmonad] Config File Format

Gwern Branwen gwern0 at gmail.com
Thu May 15 01:20:08 EDT 2008

On 2008.05.11 12:46:18 -0700, Devin Mullins <me at twifkak.com> scribbled 2.4K characters:
> 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
> why...

This looks like an interesting approach, and better in some ways (more uniform, less deliberately Haskell stuff).

But I think there's some downsides to revamping everything instead of, say, mandating that examples avoid '$'*, making the functions to use more consistent, etc.

> 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

For example, why do we have all these repeated <:>? If monads are 'programmable semicolons', surely we could get rid of them. :)

Another thing: when I cast myself into a beginner's mind, I see no reason that modMask and terminal use '<=>', but layout and layoutHook must use '<+>'. All look like they're updating a variable.

>     <:> keys <-> "M-b"

This is just mysterious. What is keys doing, why does it want a String with internal keysym formatting, and what's this '<->'? If <=> adds and updates state, does a minus somehow remove or subtract M-b?

>     <:> global <+> withUrgencyHook dzenUrgencyHook ["-bg", "darkgreen"]

Here again: based on the above, perhaps I could tentatively conclude '<+>' has some special layout meaning, but all of a sudden it's being used with some 'global' variable. Yes, it mentions hooks, like layoutHook, but layout has apparently nothing to do with hooks...

So I worry that this approach might lead to too much 'magic' and mysteriousness. The current config file at least is discoverable: once you learn haskell syntax, you can then consult the haddocks and find out everything you need to know, and why everything is the way it is. And if you already know Haskell, then it's just a matter of learning some libraries, something you do all the time.

But a list of variable updates, that can be just a mess. It reminds me of my .zsh config files, as much as I try to structure and write it elegantly.

* Actually, would anyone lynch me if I did something like go through XMC and remove all the $s from the examples and docs?

Layer domination missile PFS sweeping Hitwords grove CTP Ingram charges
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080515/67989321/attachment.bin

More information about the xmonad mailing list