Personal tools

Xmonad/Config archive/Octoploid's xmonad.hs

From HaskellWiki

< Xmonad | Config archive(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
 
<haskell>
 
<haskell>
import XMonad
+
import XMonad
import XMonad.Layouts
+
import XMonad.Layout
 
import XMonad.Config (defaultConfig)
 
import XMonad.Config (defaultConfig)
 
import XMonad.Layout.NoBorders
 
import XMonad.Layout.NoBorders
 
import XMonad.Hooks.DynamicLog
 
import XMonad.Hooks.DynamicLog
import XMonad.Actions.RotView
+
import XMonad.Actions.CycleWS
 
import Data.Bits
 
import Data.Bits
 
import qualified Data.Map as M
 
import qualified Data.Map as M
Line 14: Line 14:
 
main :: IO ()
 
main :: IO ()
 
main = do
 
main = do
xmobar <- spawnPipe "xmobar"
+
xmobar <- spawnPipe "xmobar"
xmonad defaultConfig
+
xmonad defaultConfig
{ defaultGaps = [(15,0,0,0)]
+
{ defaultGaps = [(15,0,0,0)]
, normalBorderColor = "#222222"
+
, normalBorderColor = "#222222"
, focusedBorderColor = "#6666ff"
+
, focusedBorderColor = "#aa9900"
, terminal = "gnome-terminal"
+
, terminal = "gnome-terminal"
, logHook = dynamicLogWithPP defaultPP { ppTitle = shorten 160
+
, logHook = dynamicLogWithPP defaultPP { ppTitle = shorten 160
, ppLayout = (>> "")
+
, ppLayout = (>> "")
, ppOutput = hPutStrLn xmobar }
+
, ppOutput = hPutStrLn xmobar }
, manageHook = composeAll [ className =? "fontforge" --> doFloat,
+
-- , modMask = mod4Mask
className =? "MPlayer" --> doFloat,
+
, layoutHook = smartBorders (tiled ||| Full)
className =? "Gimp" --> doFloat]
+
, manageHook = composeAll [ className =? "fontforge" --> doFloat,
, layoutHook = smartBorders (tiled ||| Full)
+
className =? "MPlayer" --> doFloat,
, keys = \c -> mykeys c `M.union` keys defaultConfig c
+
className =? "Gimp" --> doFloat]
}
+
where
+
, keys = \c -> mykeys c `M.union` keys defaultConfig c
  +
}
  +
where
 
tiled = Tall nmaster delta ratio
 
tiled = Tall nmaster delta ratio
   
Line 41: Line 41:
 
delta = 0.03
 
delta = 0.03
   
mykeys (XConfig {modMask = modm}) = M.fromList $
+
mykeys (XConfig {XMonad.modMask = modm}) = M.fromList $
[ ((controlMask .|. modm, xK_Right), rotView True)
+
[ ((controlMask .|. modm, xK_Right), nextWS)
, ((controlMask .|. modm, xK_Left), rotView False) ]
+
, ((controlMask .|. modm, xK_Left), prevWS)
  +
, ((modm, xK_m ), spawn "minefield")
  +
, ((modm, xK_f ), spawn "firefox") ]
  +
 
</haskell>
 
</haskell>
   

Revision as of 05:42, 10 June 2008

import XMonad
import XMonad.Layout
import XMonad.Config (defaultConfig)
import XMonad.Layout.NoBorders
import XMonad.Hooks.DynamicLog
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
         { defaultGaps = [(15,0,0,0)]
         , normalBorderColor  = "#222222"
         , focusedBorderColor = "#aa9900"
         , terminal = "gnome-terminal"
         , logHook = dynamicLogWithPP defaultPP { ppTitle  = shorten 160
                                                , ppLayout = (>> "")
                                                , ppOutput = hPutStrLn xmobar }
--         , modMask = mod4Mask
         , layoutHook = smartBorders (tiled ||| Full)
         , manageHook = composeAll [ className =? "fontforge" --> doFloat,
                                     className =? "MPlayer"   --> doFloat,
                                     className =? "Gimp"      --> doFloat]
 
         , 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_m     ), spawn "minefield")
             , ((modm, xK_f     ), spawn "firefox") ]