2017-08-15 54 views
1

我試圖從托盤圖標打開skype/discord時將程序窗口移動到特定工作區"11:w-"並將當前屏幕切換到此工作區。我的問題是我無法獲得正確的類型。如何在Xmonad的manageHook中鏈接多個操作?

myManageHook = composeAll . concat $ 
    [ [ className =? t --> sequence [doShift "11:w-", screenWorkspace "11:w-"] | t <- rarelyUsedApps] ] 

rarelyUsedApps = ["Skype", "discord"] 

此代碼產生一個錯誤

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. 

回答