xmonad-contrib-0.7: Third party extensions for xmonadContentsIndex
XMonad.Config.PlainConfig
MaintainerBraden Shepherdson <Braden.Shepherdson@gmail.com>
Contents
Introduction
Supported Layouts
Support Key Bindings
Other Notes
Example Config File
Description
Proof-of-concept (but usable) plain-text configuration file parser, for use instead of xmonad.hs. Does not require recompilation, allowing xmonad to be free of the GHC dependency.
Synopsis
plainConfig :: IO ()
readConfig :: IO (Maybe (XConfig Layout))
checkConfig :: IO Bool
Introduction

The xmonad.hs file is very minimal when used with PlainConfig. It typically contains only the following:

 module Main where
 import XMonad
 import XMonad.Config.PlainConfig (plainConfig)
 main = plainConfig

The plainConfig function parses ~/.xmonad/xmonad.conf, the format of which is described below.

Supported Layouts
Only Tall, Wide and Full are supported at present.
Support Key Bindings

Key bindings are specified as a pair of an arbitrary EZConfig and one of the following:

   Name                     Haskell equivalent                                          Default binding(s)
  • spawn <cmd>           spawn "<cmd>"                                               none
  • kill                  kill                                                        M-S-c
  • nextLayout            sendMessage NextLayout                                      M-<Space>
  • refresh               refresh                                                     M-S-<Space>
  • focusDown             windows W.focusDown                                         M-<Tab>, M-j
  • focusUp               windows W.focusUp                                           M-k
  • focusMaster           windows W.focusMaster                                       M-m
  • swapDown              windows W.swapDown                                          M-S-j
  • swapUp                windows W.swapUp                                            M-S-k
  • swapMaster            windows W.swapMaster                                        M-<Return>
  • shrink                sendMessage Shrink                                          M-h
  • expand                sendMessage Expand                                          M-l
  • sink                  withFocused $ windows . W.sink                              M-t
  • incMaster             sendMessage (IncMasterN 1)                                  M-,
  • decMaster             sendMessage (IncMasterN (-1))                               M-.
  • quit                  io $ exitWith ExitSuccess                                   M-S-q
  • restart               broadcastMessageReleaseResources >> restart "xmonad" True   M-q
Other Notes
Submaps are allowed. These settings override the defaults. Changes made here will be used over the default bindings for those keys.
Example Config File

An example ~/.xmonad/xmonad.conf file follows:

modMask       = 3
numlockMask   = 2
borderWidth   = 1
normalBorderColor    	=   #dddddd
focusedBorderColor      =   #00ff00
terminal=urxvt
workspaces=["1: IRC","2: Web", "3", "4", "5", "6", "7", "8", "9"]
focusFollowsMouse=True
layouts=["Tall","Full","Wide"]
key=("M-x t", "spawn xmessage Test")
manageHook=(ClassName "MPlayer"       , "float"  )
manageHook=(ClassName "Gimp"          , "float"  )
manageHook=(Resource  "desktop_window", "ignore" )
manageHook=(Resource  "kdesktop"      , "ignore" )
manageHook=(Resource  "gnome-panel"   , "ignore" )
plainConfig :: IO ()
Handles the unwrapping of the Layout. Intended for use as main = plainConfig
readConfig :: IO (Maybe (XConfig Layout))
Core function that attempts to parse ~/.xmonad/xmonad.conf
checkConfig :: IO Bool
Attempts to run readConfig, and checks if it failed.
Produced by Haddock version 0.8