Search code examples
haskellxmonad

Xmonad add fading to logHook


I am beginner in haskell and my question may be obvious. I would like to add fading in xmonad de. The code:

xmonad $ defaultConfig                                                  
         { manageHook = manageDocks <+> manageHook defaultConfig
         , layoutHook = smartSpacing 7 $ avoidStruts $ layoutHook defaultConfig
         , borderWidth = 1
         , logHook = dynamicLogWithPP $ xmobarPP
                         { ppOutput = hPutStrLn xmproc
                         , ppTitle = xmobarColor "green" "" . shorten 50
                         }
         , modMask = mod4Mask
         ...

I need to append fadeInactive to logHook.

fadeInactiveLogHook fadeAmount
     where fadeAmount = 0.8

I tried:

logHook = fadeInactiveLogHook 0.8 $ dynamicLogWithPP $ xmobarPP
                            { ppOutput = hPutStrLn xmproc
                            , ppTitle = xmobarColor "green" "" . shorten 
                            }

But its wrong.


Solution

  • Not so obvious for a Haskell beginner. You must use

    logHook = fadeInactiveLogHook 0.8 
              <+> dynamicLogWithPP xmobarPP
                      { ppOutput = hPutStrLn xmproc
                      , ppTitle = xmobarColor "green" "" . shorten 50
                      }
    

    (has been corrected according to the comment)