0

在我的 xmonad 配置中,我有以下内容:

main = do 
  xmproc <- spawnPipe "xmobar -x 0 ~.config/xmobar/xmobar.config"
  xmonad $ docks defaults

但是chrome有问题,我需要添加这个:

import XMonad
import XMonad.Hooks.EwmhDesktops

main = xmonad $ ewmh def{ handleEventHook =
           handleEventHook def <+> fullscreenEventHook }

我不确定如何将这两者结合起来。所以为了保持 xmobar 配置,码头默认值和 ewmh

我试过这个

main = do 
  xmproc <- spawnPipe "xmobar -x 0 ~.config/xmobar/xmobar.config"
  xmonad $ ewmh def{ handleEventHook =
           handleEventHook def <+> fullscreenEventHook }

但我也需要添加码头。

更新:

谢谢你的建议李耀夏。我试过这个:

  xmproc <- spawnPipe "xmobar -x 0 ~/.config/xmobar/xmobar.config"
  xmonad $ docks defaults $ ewmh def{ handleEventHook =
     handleEventHook def <+> fullscreenEventHook }

但这给出了错误

XMonad will use ghc to recompile, because "/home/adam/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/adam/.xmonad/xmonad.hs

xmonad.hs:273:12: error:
    • Couldn't match expected type ‘XConfig
                                      (Choose Tall (Choose (Mirror Tall) Full))
                                    -> XConfig l0’
                  with actual type ‘XConfig
                                      (XMonad.Layout.LayoutModifier.ModifiedLayout
                                         AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))’
    • The first argument of ($) takes one argument,
      but its type ‘XConfig
                      (XMonad.Layout.LayoutModifier.ModifiedLayout
                         AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))’
      has none
      In the second argument of ‘($)’, namely
        ‘docks defaults
           $ ewmh
               def
                 {handleEventHook = handleEventHook def <+> fullscreenEventHook}’
      In a stmt of a 'do' block:
        xmonad
          $ docks defaults
              $ ewmh
                  def {handleEventHook = handleEventHook def <+> fullscreenEventHook}
    |
273 |   xmonad $ docks defaults $ ewmh def{ handleEventHook =
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

Please check the file for errors.

xmonad: xmessage: executeFile: does not exist (No such file or directory)
4

1 回答 1

2

请注意,docks两者ewmh都需要一个配置

docks :: XConfig a -> XConfig a
ewmh  :: XConfig a -> XConfig a

它们是函数,可以组合

  xmonad $ docks $ ewmh def{ handleEventHook =
           handleEventHook def <+> fullscreenEventHook }

您似乎还有一个自定义 config defaults :: XConfig a,您可以使用它来代替def(这是 XMonad 本身提供的默认值)

  xmonad $ docks $ ewmh defaults{ handleEventHook =
           handleEventHook defaults <+> fullscreenEventHook }

  -- note there are two occurrences of "defaults" here (you definitely want the first one, and the second one matters if defaults and def have different definitions of handleEventHook)
于 2020-06-05T15:03:35.010 回答