diff options
author | Devin Mullins <me@twifkak.com> | 2007-10-30 08:24:55 +0100 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2007-10-30 08:24:55 +0100 |
commit | eba7c0ca10e67eae61630008946d69f7eb582623 (patch) | |
tree | ac2cae1f9b342853fa9f86a453c882028825c6a6 | |
parent | 17ea034ad39ef4896eeefe11e9d687c0a87ae2ef (diff) | |
download | XMonadContrib-eba7c0ca10e67eae61630008946d69f7eb582623.tar.gz XMonadContrib-eba7c0ca10e67eae61630008946d69f7eb582623.tar.xz XMonadContrib-eba7c0ca10e67eae61630008946d69f7eb582623.zip |
expose dzenWithArgs, dzenUrgencyHookWithArgs (for colors!)
darcs-hash:20071030072455-78224-00f7afe4e6f6fff303c74bfaf58949ec88bcefc0.gz
Diffstat (limited to '')
-rw-r--r-- | Dzen.hs | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -12,7 +12,9 @@ -- ----------------------------------------------------------------------------- -module XMonadContrib.Dzen (dzen, dzenScreen, dzenUrgencyHook, seconds) where +module XMonadContrib.Dzen (dzen, dzenWithArgs, dzenScreen, + dzenUrgencyHook, dzenUrgencyHookWithArgs, + seconds) where import Control.Monad (when) import Control.Monad.State (gets) @@ -44,14 +46,18 @@ dzenScreen sc str timeout = dzenWithArgs str ["-xs", screen] timeout -- XMonadContrib.UrgencyHook. Usage: -- > urgencyHook = dzenUrgencyHook (5 `seconds`) dzenUrgencyHook :: Int -> Window -> X () -dzenUrgencyHook duration w = do +dzenUrgencyHook = dzenUrgencyHookWithArgs [] + +dzenUrgencyHookWithArgs :: [String] -> Int -> Window -> X () +dzenUrgencyHookWithArgs args duration w = do visibles <- gets mapped name <- getName w ws <- gets windowset whenJust (W.findTag w ws) (flash name visibles) where flash name visibles index = when (not $ S.member w visibles) $ - dzen (show name ++ " requests your attention on workspace " ++ index) duration + dzenWithArgs (show name ++ " requests your attention on workspace " ++ index) + args duration dzenWithArgs :: String -> [String] -> Int -> X () dzenWithArgs str args timeout = io $ runProcessWithInputAndWait "dzen2" args (unchomp str) timeout |