mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
expose dzenWithArgs, dzenUrgencyHookWithArgs (for colors!)
This commit is contained in:
parent
5c9a9e68c4
commit
fd268ab7b9
12
Dzen.hs
12
Dzen.hs
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user