我在两个不同的 Linux 安装上具有完全相同的 Xmonad.hs 配置,虽然它在我第一次安装它的计算机上运行良好,但它在第二次安装时导致错误。这是配置文件:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import System.IO
main = do
xmproc <- spawnPipe "~/.cabal/bin/xmobar ~/.xmobarrc"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 80
}
, terminal = "urxvt"
, modMask = mod1Mask
, borderWidth = 1 --was "3"
, focusedBorderColor = "#4099FF"
, normalBorderColor = "#474747"
}
这是它在第二台计算机上导致的错误(反映在 nacr.us/media/xmonad.errors):
xmonad.hs:11:20:
Couldn't match expected type `ManageHook'
with actual type `xmonad-0.10:XMonad.Core.ManageHook'
In the first argument of `(<+>)', namely `manageDocks'
In the `manageHook' field of a record
In the second argument of `($)', namely
`defaultConfig
{manageHook = manageDocks <+> manageHook defaultConfig,
layoutHook = avoidStruts $ layoutHook defaultConfig,
logHook = dynamicLogWithPP
(xmobarPP
{ppOutput = hPutStrLn xmproc,
ppTitle = xmobarColor "green" "" . shorten 80}),
terminal = "urxvt", modMask = mod1Mask, borderWidth = 1,
focusedBorderColor = "#4099FF", normalBorderColor = "#474747"}'
此外,xmonad 的两个安装都在相同版本的 Ubuntu 12.04 上,并且安装的 xmonad 版本相同(根据apt-cache show xmonad
)。
有什么我忘记的吗?我终其一生都无法弄清楚问题所在。
此外,这是我的 dotfiles 存储库,其中包含所有相关文件:https ://github.com/lelandbatey/configDebDev