Haskell 如何在Xmonad中的manageHook上链接多个操作?
我试图在从托盘打开skype/discord图标时获得效果,将程序窗口移动到特定的工作区Haskell 如何在Xmonad中的manageHook上链接多个操作?,haskell,xmonad,Haskell,Xmonad,我试图在从托盘打开skype/discord图标时获得效果,将程序窗口移动到特定的工作区“11:w-”,并将当前屏幕切换到此工作区。我的问题是我找不到正确的类型 myManageHook = composeAll . concat $ [ [ className =? t --> sequence [doShift "11:w-", screenWorkspace "11:w-"] | t <- rarelyUsedApps] ] rarelyUsedApps = ["S
“11:w-”
,并将当前屏幕切换到此工作区。我的问题是我找不到正确的类型
myManageHook = composeAll . concat $
[ [ className =? t --> sequence [doShift "11:w-", screenWorkspace "11:w-"] | t <- rarelyUsedApps] ]
rarelyUsedApps = ["Skype", "discord"]
我刚刚意识到上面代码的第一个错误是我将工作区名称而不是工作区id传递给
screenWorkspace“11:w-”
。也,
screenWorkspace
对于我的目标来说是一个完全错误的功能
不管怎样,我发现我想要的已经包含在维基中了
Error detected while loading xmonad configuration file: /home/i/.xmonad/xmonad.hs
xmonad.hs:268:33:
Couldn't match type `[Data.Monoid.Endo WindowSet]'
with `Data.Monoid.Endo
(W.StackSet
WorkspaceId (Layout Window) Window ScreenId ScreenDetail)'
Expected type: Query
(Data.Monoid.Endo
(W.StackSet
WorkspaceId (Layout Window) Window ScreenId ScreenDetail))
Actual type: Query [Data.Monoid.Endo WindowSet]
In the return type of a call of `sequence'
In the second argument of `(-->)', namely
`sequence [doShift "11:w-", screenWorkspace "11:w-"]'
In the expression:
className =? t
--> sequence [doShift "11:w-", screenWorkspace "11:w-"]
xmonad.hs:268:60:
Couldn't match type `X' with `Query'
Expected type: Query (Data.Monoid.Endo WindowSet)
Actual type: X (Maybe WorkspaceId)
In the return type of a call of `screenWorkspace'
In the expression: screenWorkspace "11:w-"
In the first argument of `sequence', namely
`[doShift "11:w-", screenWorkspace "11:w-"]'
xmonad.hs:268:76:
Couldn't match expected type `ScreenId' with actual type `[Char]'
In the first argument of `screenWorkspace', namely `"11:w-"'
In the expression: screenWorkspace "11:w-"
In the first argument of `sequence', namely
`[doShift "11:w-", screenWorkspace "11:w-"]'
Please check the file for errors.