Personal tools

Xmonad/Config archive/Wfarr's xmonad.hs

From HaskellWiki

< Xmonad | Config archive(Difference between revisions)
Jump to: navigation, search
m
m
Line 80: Line 80:
 
, (f, m) <- [(W.view, ""), (W.shift, "-S"), (copy, "-C-S")]]
 
, (f, m) <- [(W.view, ""), (W.shift, "-S"), (copy, "-C-S")]]
   
myDzenFlags = "-e '' -w 900 -ta l"
+
myDzenFlags = "-e '' -y 1182 -w 900 -ta l"
 
myUrgencyHook = withUrgencyHook dzenUrgencyHook
 
myUrgencyHook = withUrgencyHook dzenUrgencyHook
 
{ args = ["-bg", "yellow", "-fg", "black"] }
 
{ args = ["-bg", "yellow", "-fg", "black"] }
Line 137: Line 137:
 
export OOO_FORCE_DESKTOP=gnome
 
export OOO_FORCE_DESKTOP=gnome
 
xsetroot -cursor_name left_ptr
 
xsetroot -cursor_name left_ptr
xmonad-clock | dzen2 -e '' -x 400 -w 1200 -ta r &
+
xmonad-clock | dzen2 -e '' -x 900 -y 1182 -w 700 -ta r &
 
dbus-launch --sh-syntax --exit-with-session $HOME/bin/xmonad
 
dbus-launch --sh-syntax --exit-with-session $HOME/bin/xmonad
 
</haskell>
 
</haskell>

Revision as of 15:28, 14 March 2008

This is the ~/.xmonad/xmonad.hs file.

import XMonad
import Control.Monad.Fix
 
import qualified XMonad.StackSet as W
import qualified Data.Map        as M
 
import XMonad.Actions.CopyWindow
import XMonad.Actions.CycleWS
import XMonad.Actions.WindowBringer
 
import XMonad.Layout.Reflect
import XMonad.Layout.ResizableTile
import XMonad.Layout.WindowNavigation
 
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
 
import XMonad.Prompt
import XMonad.Prompt.Theme
 
import XMonad.Util.EZConfig
import XMonad.Util.Run
import XMonad.Util.Scratchpad
import XMonad.Util.Themes
 
import System.Exit
import System.IO
 
main = do
  h <- spawnPipe ("dzen2" ++ " " ++ myDzenFlags)
  xmonad $ myUrgencyHook $ defaultConfig
       { terminal = "gnome-terminal"
       , borderWidth = 2
       , normalBorderColor = "#333333"
       , focusedBorderColor = "#4c7899"
       , modMask = mod3Mask
       , layoutHook = myLayout
       , workspaces = myWorkspaces
       , manageHook = (manageHook defaultConfig <+> myManageHook) <+> manageDocks
       , logHook = dynamicLogWithPP $ myLogHook h
       }
       `additionalKeysP` myKeys
 
myKeys = [ ("M-p",        spawn "exe=`dmenu_path | dmenu -b` && eval \"exec $exe\"")
         , ("M-e",        spawn "emacs")
         , ("M-f",        spawn "firefox-3.0")
         , ("M-<Return>", spawn "gnome-terminal")
 
         , ("M-S-m", windows W.swapMaster)
 
         , ("M-u", focusUrgent)
 
         , ("M-b", sendMessage ToggleStruts)
 
         , ("M-a", sendMessage MirrorShrink)
         , ("M-z", sendMessage MirrorExpand)
 
         , ("M-s",   spawn $ "gnome-terminal --title scratchpad")
 
         , ("M-S-<R>",  moveTo Next NonEmptyWS)
         , ("M-S-<L>",  moveTo Prev NonEmptyWS)
 
         , ("M-S-t", themePrompt defaultXPConfig)
 
         , ("M-S-g", gotoMenu)
         , ("M-S-b", bringMenu)
 
         , ("M-c",   kill1) -- Removes window from ws if possible, else kills
         , ("M-S-k", kill)
         ]
 
         ++
         -- This enables view switching, window shifting, and window copying
                  [("M" ++ m ++ ('-':k:[]) , windows $ f i)
                       | (i, k) <- zip myWorkspaces ['1'..'9']
                       , (f, m) <- [(W.view, ""), (W.shift, "-S"), (copy, "-C-S")]]
 
myDzenFlags = "-e '' -y 1182 -w 900 -ta l"
myUrgencyHook = withUrgencyHook dzenUrgencyHook
    { args = ["-bg", "yellow", "-fg", "black"] }
 
myWorkspaces :: [String]
myWorkspaces = ["1:main", "2:music", "3:emacs", "4:im", "5:email", "6:web" ]
              ++ map show [7 .. 9 :: Int]
 
myManageHook = composeAll
 
               [ -- Organized by the workspace they go to
                 className   =? "Nereid"      --> doF(copy "2:music")
               , className   =? "Cowbell"     --> doF(copy "2:music")
               , className   =? "Emacs"       --> doF(copy "3:emacs")
               , className   =? "Empathy"     --> doF(copy "4:im")
               , className   =? "Pidgin"      --> doF(copy "4:im")
               , className   =? "Thunderbird" --> doF(copy "5:email")
               , className   =? "Firefox"     --> doF(copy "6:web")
               ]
 
myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
   where
       tiled = windowNavigation (ResizableTall nmaster delta ratio [])
       nmaster = 1
       ratio = 1/2
       delta = 3/100
 
myLogHook handle = defaultPP
                   { ppOutput = hPutStrLn handle
                   , ppCurrent = dzenColor "white" "#4c7899" . pad
                   , ppVisible = dzenColor "" "" . pad
                   , ppHidden = dzenColor "" "" . pad
                   , ppUrgent = dzenColor "red" "yellow"
                   , ppTitle = dzenColor "" "" . dzenEscape . pad
                   , ppHiddenNoWindows = const ""
                   , ppWsSep    = "|"
                   , ppSep      = "|"
                   , ppLayout   = dzenColor "" "" .
                                  (\ x -> case x of
                                            "TilePrime Horizontal" -> " TTT "
                                            "TilePrime Vertical"   -> " []= "
                                            "Hinted Full"          -> " [ ] "
                                            _                      -> pad x
                                  )
                   }

This is the ~/.xsession file:

# .xsession
xrdb -merge .Xresources
xsetroot -solid '#333333'
xmodmap ~/.xmodmap
export OOO_FORCE_DESKTOP=gnome
xsetroot -cursor_name left_ptr
xmonad-clock | dzen2 -e '' -x 900 -y 1182 -w 700 -ta r &
dbus-launch --sh-syntax --exit-with-session $HOME/bin/xmonad