Personal tools

Xmonad/Config archive/Ray's xmonad.hs

From HaskellWiki

< Xmonad | Config archive
Revision as of 05:53, 7 November 2007 by Ray (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
import XMonad                                                                                            
import XMonad.Layouts                                                                                    
import XMonad.Operations                                                                                 
import XMonad.Hooks.DynamicLog                                                                           
import XMonad.Layout.NoBorders                                                                           
import qualified XMonad.StackSet as W                                                                    
import Graphics.X11                                                                                      
import Data.Ratio                                                                                        
 
main = xmonad $ defaultConfig                                                                            
       { normalBorderColor        = "#333333"                                                            
       , focusedBorderColor       = "#0000ff"                                                            
       , workspaces               = ["term", "web"] ++ map show [3..9]                                   
       , terminal                 = "rayterm"                                                            
       , defaultGaps              = [(18,0,0,0)]                                                         
       , modMask                  = mod4Mask                                                             
       , manageHook               = rayManageHook                                                        
       , logHook                  = dynamicLog                                                           
       , layoutHook               = Layout                                                               
                                    $   Mirror (Tall 1 0 (1%2))                                          
                                    ||| (noBorders Full)                                                 
       }                                                                                                 
 
rayManageHook :: Window -- ^ the new window to manage                                                    
              -> String -- ^ window title                                                                
              -> String -- ^ window resource name                                                        
              -> String -- ^ window resource class                                                       
              -> X (WindowSet -> WindowSet)                                                              
rayManageHook w _ _ c | c `elem` floats = fmap (W.float w . snd) (floatLocation w)                       
                      where floats = ["MPlayer", "Gimp"]                                                 
rayManageHook _ _ _ "Opera" = return $ W.shift "web"                                                     
rayManageHook _ _ _ _ = return $ id