[xmonad] darcs patch: XMonad.Config.PlainConfig

Joachim Breitner mail at joachim-breitner.de
Sun May 18 08:14:53 EDT 2008


Hi,

a few comments from my side.

Am Samstag, den 17.05.2008, 18:40 -0400 schrieb Braden Shepherdson:
> +
> +-- | The standard Config.hs 'defaultConfig', with the layout wrapped.
> +baseConfig :: XConfig Layout
> +baseConfig = defaultConfig{ layoutHook = Layout (layoutHook defaultConfig) }

Could you make it possible to pass the default configuration to
readConfig as an parameter, so that I can change some defaults for the
Debian package?

> +-- | Core function that attempts to parse @~\/.xmonad\/xmonad.conf@
> +readConfig :: IO (Maybe (XConfig Layout))
> +readConfig = do
> +  cs <- bracket (openFile "/home/braden/.xmonad/xmonad.conf" ReadMode)

You surely want to make that independent of the users’ login name, do
you :-)


> +-- | Handles the unwrapping of the Layout. Intended for use as
> +--   @main = plainConfig@
> +plainConfig :: IO ()
> +plainConfig = do
> +  conf <- readConfig
> +  case conf of
> +    (Just xc at XConfig{layoutHook= (Layout l)}) -> 
> +        xmonad (xc{ layoutHook = l })
> +    Nothing                                   -> 
> +        spawn $ "xmessage Failed to read xmonad.conf. See xmonad.errors."
> +

What happens here if there is no xmonad.conf. Does it use the
baseConfig, or does it produce an error?

Greetings,
Joachim
-- 
Joachim Breitner
  e-Mail: mail at joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
  Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.haskell.org/pipermail/xmonad/attachments/20080518/5d2d39f5/attachment.bin


More information about the xmonad mailing list