首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将这两个配置部分连接在一起?

如何将这两个配置部分连接在一起?
EN

Stack Overflow用户
提问于 2020-06-05 22:56:24
回答 1查看 403关注 0票数 0

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

代码语言:javascript
复制
main = do 
  xmproc <- spawnPipe "xmobar -x 0 ~.config/xmobar/xmobar.config"
  xmonad $ docks defaults

但是在使用chrome时遇到了问题,我需要添加以下内容:

代码语言:javascript
复制
import XMonad
import XMonad.Hooks.EwmhDesktops

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

我不确定如何将这两者结合起来。因此,为了保持xmobar配置,docks默认设置和ewmh

我试过了

代码语言:javascript
复制
main = do 
  xmproc <- spawnPipe "xmobar -x 0 ~.config/xmobar/xmobar.config"
  xmonad $ ewmh def{ handleEventHook =
           handleEventHook def <+> fullscreenEventHook }

但我也需要添加码头。

更新:

谢谢你的建议,李-姚夏。我试过这个:

代码语言:javascript
复制
  xmproc <- spawnPipe "xmobar -x 0 ~/.config/xmobar/xmobar.config"
  xmonad $ docks defaults $ ewmh def{ handleEventHook =
     handleEventHook def <+> fullscreenEventHook }

但这给出了错误

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-05 23:03:35

请注意,docksewmh都接受配置

代码语言:javascript
复制
docks :: XConfig a -> XConfig a
ewmh  :: XConfig a -> XConfig a

它们是可以组合的函数

代码语言:javascript
复制
  xmonad $ docks $ ewmh def{ handleEventHook =
           handleEventHook def <+> fullscreenEventHook }

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

代码语言:javascript
复制
  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)
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62218285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档