Xmonad/Config archive/Octoploid's xmonad.hs

From HaskellWiki
< Xmonad‎ | Config archive
Revision as of 14:24, 1 December 2007 by Octoploid (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
import XMonad                                                                                                                    
import XMonad.Layouts
import XMonad.Config (defaultConfig)
import XMonad.Layout.NoBorders
import XMonad.Hooks.DynamicLog
import XMonad.Actions.RotView
import Data.Bits
import qualified Data.Map as M
import XMonad.Util.Run (spawnPipe)
import System.IO (hPutStrLn)
import Graphics.X11

main :: IO ()
main = do
       xmobar <- spawnPipe "xmobar"
       xmonad defaultConfig
        { defaultGaps = [(15,0,0,0)]
        , normalBorderColor  = "#222222"
        , focusedBorderColor = "#6666ff"
        , terminal = "gnome-terminal"
        , logHook = dynamicLogWithPP defaultPP { ppTitle = shorten 160
                                               , ppLayout = (\_ -> "")
                                               , ppOutput = hPutStrLn xmobar }
        , modMask = mod4Mask
        , layoutHook = smartBorders (tiled ||| Full)
        , keys = \c -> mykeys c `M.union` keys defaultConfig c
        }
 where
     tiled   = Tall nmaster delta ratio

     -- The default number of windows in the master pane
     nmaster = 1

     -- Default proportion of screen occupied by master pane
     ratio   = 2/(1+(toRational(sqrt(5)::Float))) -- golden

     -- Percent of screen to increment by when resizing panes
     delta   = 0.03

     mykeys (XConfig {modMask = modm}) = M.fromList $
             [ ((controlMask .|. modm, xK_Right), rotView True)
             , ((controlMask .|. modm, xK_Left), rotView False) ]