Personal tools

Xmonad/Config archive/Octoploid's xmonad.hs

From HaskellWiki

< Xmonad | Config archive(Difference between revisions)
Jump to: navigation, search
m
m
Line 2: Line 2:
 
import XMonad
 
import XMonad
 
import XMonad.Layout
 
import XMonad.Layout
  +
import XMonad.Hooks.ManageDocks
 
import XMonad.Config (defaultConfig)
 
import XMonad.Config (defaultConfig)
 
import XMonad.Layout.NoBorders
 
import XMonad.Layout.NoBorders
import XMonad.Actions.UpdatePointer
 
 
import XMonad.Layout.Gaps
 
import XMonad.Layout.Gaps
 
import XMonad.Hooks.DynamicLog hiding (xmobar)
 
import XMonad.Hooks.DynamicLog hiding (xmobar)
Line 20: Line 20:
 
xmonad defaultConfig
 
xmonad defaultConfig
 
{ normalBorderColor = "#222222"
 
{ normalBorderColor = "#222222"
, focusedBorderColor = "#aa9900"
+
, focusedBorderColor = "#EF2929"
  +
, borderWidth = 1
 
, terminal = "xterm"
 
, terminal = "xterm"
, logHook = dynamicLogWithPP defaultPP { ppTitle = shorten 160
+
, logHook = dynamicLogWithPP defaultPP { ppTitle = shorten 90
 
, ppLayout = (>> "")
 
, ppLayout = (>> "")
 
, ppOutput = hPutStrLn xmobar }
 
, ppOutput = hPutStrLn xmobar }
>> updatePointer (Relative 0.95 0.95)
+
, layoutHook = avoidStruts ( smartBorders (Full ||| Mirror tiled ||| tiled))
, layoutHook = gaps [(U,15)] (smartBorders (Mirror tiled ||| tiled ||| Full))
+
, manageHook = composeAll [ className =? "fontforge" --> doFloat,
, manageHook = composeAll [ className =? "fontforge" --> doFloat,
+
className =? "MPlayer" --> doFloat,
className =? "MPlayer" --> doFloat,
+
title =? "glxgears" --> doFloat,
className =? "Gimp" --> doFloat]
+
className =? "Gimp" --> doFloat]
  +
<+> manageDocks
 
, keys = \c -> mykeys c `M.union` keys defaultConfig c
 
, keys = \c -> mykeys c `M.union` keys defaultConfig c
 
}
 
}
Line 35: Line 35:
 
tiled = Tall nmaster delta ratio
 
tiled = Tall nmaster delta ratio
   
-- The default number of windows in the master pane
+
-- The default number of windows in the master pane
 
nmaster = 1
 
nmaster = 1
   
Line 47: Line 47:
 
[ ((controlMask .|. modm, xK_Right), nextWS)
 
[ ((controlMask .|. modm, xK_Right), nextWS)
 
, ((controlMask .|. modm, xK_Left), prevWS)
 
, ((controlMask .|. modm, xK_Left), prevWS)
, ((modm, xK_b), sendMessage $ ToggleGaps)
+
, ((modm, xK_b), sendMessage ToggleStruts)
, ((modm, xK_f), spawn "firefox") ]
+
, ((modm, xK_f), spawn "firefox") ]
 
</haskell>
 
</haskell>
 
[[Category:XMonad configuration]]
 
[[Category:XMonad configuration]]

Revision as of 06:36, 20 October 2009

import XMonad
import XMonad.Layout
import XMonad.Hooks.ManageDocks
import XMonad.Config (defaultConfig)
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Hooks.DynamicLog hiding (xmobar)
import XMonad.Actions.CycleWS
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
         { normalBorderColor  = "#222222"
         , focusedBorderColor = "#EF2929"
	 , borderWidth        = 1
         , terminal = "xterm"
         , logHook = dynamicLogWithPP defaultPP { ppTitle  = shorten 90
                                                , ppLayout = (>> "")
                                                , ppOutput = hPutStrLn xmobar }
         , layoutHook = avoidStruts ( smartBorders (Full ||| Mirror tiled ||| tiled))
	 , manageHook = composeAll [ className =? "fontforge" --> doFloat,
	 		             className =? "MPlayer"   --> doFloat,
				     title     =? "glxgears"  --> doFloat,
		                     className =? "Gimp"      --> doFloat]
			<+> manageDocks
         , 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   = toRational (2/(1+sqrt(5)::Double)) -- golden
 
     -- Percent of screen to increment by when resizing panes
     delta   = 0.03
 
     mykeys (XConfig {XMonad.modMask = modm}) = M.fromList $
             [ ((controlMask .|. modm, xK_Right), nextWS)
             , ((controlMask .|. modm, xK_Left),  prevWS)
	     , ((modm, xK_b), sendMessage ToggleStruts) 
	     , ((modm, xK_f), spawn "firefox") ]