mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
DynamicLog: Add makeSimpleDzenConfig function
This function serves as an example for spawning a dzen2 instance and printing the defaultPP to it.
This commit is contained in:
parent
4fcd67ef05
commit
4bfbc43023
@ -31,7 +31,8 @@ module XMonad.Hooks.DynamicLog (
|
|||||||
|
|
||||||
PP(..), defaultPP, dzenPP, sjanssenPP,
|
PP(..), defaultPP, dzenPP, sjanssenPP,
|
||||||
wrap, pad, shorten,
|
wrap, pad, shorten,
|
||||||
xmobarColor, dzenColor, dzenEscape
|
xmobarColor, dzenColor, dzenEscape,
|
||||||
|
makeSimpleDzenConfig
|
||||||
) where
|
) where
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -44,7 +45,9 @@ import Data.List
|
|||||||
import Data.Ord ( comparing )
|
import Data.Ord ( comparing )
|
||||||
import qualified XMonad.StackSet as S
|
import qualified XMonad.StackSet as S
|
||||||
import Data.Monoid
|
import Data.Monoid
|
||||||
|
import System.IO
|
||||||
import XMonad.Util.NamedWindows
|
import XMonad.Util.NamedWindows
|
||||||
|
import XMonad.Util.Run
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
--
|
--
|
||||||
@ -57,6 +60,14 @@ import XMonad.Util.NamedWindows
|
|||||||
-- %def -- comment out default logHook definition above if you uncomment any of these:
|
-- %def -- comment out default logHook definition above if you uncomment any of these:
|
||||||
-- %def logHook = dynamicLog
|
-- %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:
|
-- An example log hook, print a status bar output to stdout, in the form:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user