aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Mertens <emertens@galois.com>2007-11-07 09:55:14 +0100
committerEric Mertens <emertens@galois.com>2007-11-07 09:55:14 +0100
commitdd5780040a99086cd3a3b361d4d0afaceb923c4a (patch)
tree764f72f537026d68b87ebd01ed8725817c26ce89
parent032a8bfa18fc67b6a8086b4f69e71ca83cfb0d63 (diff)
downloadXMonadContrib-dd5780040a99086cd3a3b361d4d0afaceb923c4a.tar.gz
XMonadContrib-dd5780040a99086cd3a3b361d4d0afaceb923c4a.tar.xz
XMonadContrib-dd5780040a99086cd3a3b361d4d0afaceb923c4a.zip
DynamicLog: Add makeSimpleDzenConfig function
This function serves as an example for spawning a dzen2 instance and printing the defaultPP to it. darcs-hash:20071107085514-b49f3-cefc0b026964d545f8ef746762654fe0d6a8654e.gz
-rw-r--r--XMonad/Hooks/DynamicLog.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs
index 96782fb..546622d 100644
--- a/XMonad/Hooks/DynamicLog.hs
+++ b/XMonad/Hooks/DynamicLog.hs
@@ -31,7 +31,8 @@ module XMonad.Hooks.DynamicLog (
PP(..), defaultPP, dzenPP, sjanssenPP,
wrap, pad, shorten,
- xmobarColor, dzenColor, dzenEscape
+ xmobarColor, dzenColor, dzenEscape,
+ makeSimpleDzenConfig
) where
--
@@ -44,7 +45,9 @@ import Data.List
import Data.Ord ( comparing )
import qualified XMonad.StackSet as S
import Data.Monoid
+import System.IO
import XMonad.Util.NamedWindows
+import XMonad.Util.Run
-- $usage
--
@@ -57,6 +60,14 @@ import XMonad.Util.NamedWindows
-- %def -- comment out default logHook definition above if you uncomment any of these:
-- %def logHook = dynamicLog
+-- | An example xmonad config that spawns a new dzen toolbar and uses the default
+-- dynamic log output
+makeSimpleDzenConfig :: IO XConfig
+makeSimpleDzenConfig = do
+ h <- spawnPipe "dzen2"
+ return defaultConfig
+ { logHook = dynamicLogWithPP defaultPP
+ { ppOutput = hPutStrLn h } }
-- |
-- An example log hook, print a status bar output to stdout, in the form: