2015-12-30 73 views
1

我是haskell的初學者,我的問題可能很明顯。我想在xmonad de中添加淡入淡出。代碼:Xmonad在logHook中添加淡入淡出

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 
     ... 

我需要追加fadeInactivelogHook

fadeInactiveLogHook fadeAmount 
    where fadeAmount = 0.8 

我想:

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

但它錯了。

回答

2

Haskell初學者並不那麼明顯。您必須使用

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

(已得到糾正,根據評論)

+0

也給出了錯誤。無法匹配預期的類型。 – user3003873

+0

如果刪除$,則編譯。 – user3003873