0

我在使用 XMonad 配置时遇到问题。

你能告诉我这段代码有什么问题吗?它可以编译,但没有达到预期的效果。

我在SO上没有找到类似的东西。所以这里是:

     myConfig = azertyConfig { modMask = mod4Mask
                    , layoutHook = myLayoutHook
                    , workspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
                    , terminal = "urxvt"
                    , startupHook = setWMName "LG3D"
                    , manageHook = myManageHook <+> manageHook azertyConfig
                    } `additionalKeysP` myKeys

     myXPConfig = defaultXPConfig

     myManageHook = composeAll
           [ className =? "emulator-arm" --> doFloat
           , className =? "Sylpheed" --> doShift "2:email"
           , className =? "Pidgin" --> doShift "3:im"
           , className =? "Opera" --> doShiftAndGo "4:web"
           , manageDocks
           ] where doShiftAndGo ws = doF (W.greedyView ws) <+> doShift ws

     myKeys = [ ("M-p", shellPrompt defaultXPConfig)

       -- sublayouts
     , ("M-xK_F10", raiseVolume 4 >> return ())
     , ("M-xK_F11", lowerVolume 4 >> return ())
     -- more codes

   myLayoutHook = avoidStruts $ windowNavigation $ subTabbed $
           (smartBorders tall ||| smartBorders threeCol ||| noBorders Full)
   where
      tall     = Tall nmaster delta ratio
      threeCol = ThreeCol nmaster delta ratio
      nmaster  = 1
      delta    = 3/100
      ratio    = 1/2

   main = xmonad =<< xmobar (withUrgencyHook NoUrgencyHook $ myConfig)

也试过这个,但它不编译:

     , ((modMask, xK_F10), raiseVolume 3 >> return ())
     , ((modMask, xK_F11), lowerVolume 3 >> return ())

我收到此错误:

      Couldn't match expected type `[Char]' with actual type `(t0, t1)'
      In the expression: (modMask, xK_F10)
      In the expression: (modMask, xK_F10), raiseVolume 3 >> return ())

modMask = modMask4(Windows 按钮)

谢谢你的帮助。

4

1 回答 1

0

找到了我的问题的解决方案..
替换了这一行

 main = xmonad =<< xmobar (withUrgencyHook NoUrgencyHook $ myConfig)

main = xmonad =<< xmobar (withUrgencyHook NoUrgencyHook $ myConfig){ keys =
keys myConfig `mappend`
\c -> fromList [
    ((mod4Mask, xK_F11), lowerVolume 4 >> return ()),
    ((mod4Mask, xK_F10), raiseVolume 4 >> return ())
]
}

还做了必要的进口

import Data.Map    (fromList)
import Data.Monoid (mappend)
于 2012-07-12T22:53:00.937 回答