diff options
author | Shachaf Ben-Kiki <shachaf@gmail.com> | 2007-12-15 18:16:17 +0100 |
---|---|---|
committer | Shachaf Ben-Kiki <shachaf@gmail.com> | 2007-12-15 18:16:17 +0100 |
commit | c730e61e2bb18da5e31be2deec653fc70cf86a24 (patch) | |
tree | 271d9aaab0e9886a3409f9857225d0243c27d3f4 /XMonad | |
parent | ad44e015e0a0e2cc1be033376430d071ccd61fae (diff) | |
download | XMonadContrib-c730e61e2bb18da5e31be2deec653fc70cf86a24.tar.gz XMonadContrib-c730e61e2bb18da5e31be2deec653fc70cf86a24.tar.xz XMonadContrib-c730e61e2bb18da5e31be2deec653fc70cf86a24.zip |
Add UrgencyHook support to Tabbed
darcs-hash:20071215171617-bffde-c77b72dce227d2969b9cbc6580bdb1e3123b6d27.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Layout/Tabbed.hs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/XMonad/Layout/Tabbed.hs b/XMonad/Layout/Tabbed.hs index 5733130..237db34 100644 --- a/XMonad/Layout/Tabbed.hs +++ b/XMonad/Layout/Tabbed.hs @@ -33,6 +33,8 @@ import XMonad.Util.Invisible import XMonad.Util.XUtils import XMonad.Util.Font +import XMonad.Hooks.UrgencyHook + -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: -- @@ -62,10 +64,13 @@ tabbed s t = Tabbed (I Nothing) s t data TConf = TConf { activeColor :: String , inactiveColor :: String + , urgentColor :: String , activeBorderColor :: String - , inactiveTextColor :: String , inactiveBorderColor :: String + , urgentBorderColor :: String , activeTextColor :: String + , inactiveTextColor :: String + , urgentTextColor :: String , fontName :: String , tabSize :: Int } deriving (Show, Read) @@ -74,10 +79,13 @@ defaultTConf :: TConf defaultTConf = TConf { activeColor = "#999999" , inactiveColor = "#666666" + , urgentColor = "#FFFF00" , activeBorderColor = "#FFFFFF" , inactiveBorderColor = "#BBBBBB" + , urgentBorderColor = "##00FF00" , activeTextColor = "#FFFFFF" , inactiveTextColor = "#BFBFBF" + , urgentTextColor = "#FF0000" , fontName = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , tabSize = 20 } @@ -182,13 +190,17 @@ createTabs c (Rectangle x y wh ht) owl@(ow:ows) = do updateTab :: Shrinker s => s -> TConf -> XMonadFont -> Dimension -> (Window,Window) -> X () updateTab ishr c fs wh (tabw,ow) = do nw <- getName ow + ur <- readUrgents let ht = fromIntegral $ tabSize c :: Dimension - focusColor win ic ac = (maybe ic (\focusw -> if focusw == win - then ac else ic) . W.peek) - `fmap` gets windowset + focusColor win ic ac uc = (maybe ic (\focusw -> case () of + _ | focusw == win -> ac + | win `elem` ur -> uc + | otherwise -> ic) . W.peek) + `fmap` gets windowset (bc',borderc',tc') <- focusColor ow (inactiveColor c, inactiveBorderColor c, inactiveTextColor c) (activeColor c, activeBorderColor c, activeTextColor c) + (urgentColor c, urgentBorderColor c, urgentTextColor c) dpy <- asks display let s = shrinkIt ishr name <- shrinkWhile s (\n -> do |