我有 2 个不同尺寸的显示器,其中一个是垂直放置的,我希望它们默认有不同的布局
我XMonad.Layout.IndependentScreens
用来为每个监视器分配它自己的一组工作区
我找到了一个库,可以满足我的需要XMonad.Layout.PerWorkspace
有了这个,我定义了 2 个我将使用的监视器布局:
where
-- default tiling algorithm partitions the screen into two panes
tiled = (Tall nmaster delta ratio) -- here, we can use `magicFocus`, but it creates several inconviniences
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 2/3
-- Percent of screen to increment by when resizing panes
delta = 3/100
verticalLayout = Mirror tiled ||| tabbed shrinkText myTabConfig ||| noBorders Full ||| tiled
where
-- default tiling algorithm partitions the screen into two panes
tiled = (Tall nmaster delta ratio) -- here, we can use `magicFocus`, but it creates several inconviniences
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 2/3
-- Percent of screen to increment by when resizing panes
delta = 3/100
所以现在我试图在布局挂钩上使用它们,以及来自 IndependentScreens 的 workspacesOn 函数
layoutHook = smartBorders . avoidStruts $
onWorkspaces (workspacesOn 0) myLayout $
onWorkspaces (workspacesOn 1) verticalLayout
这失败并出现以下错误:
xmonad.hs:447:27: error:
• Variable not in scope: workspacesOn :: Integer -> [WorkspaceId]
• Perhaps you meant one of these:
‘workspaces'’ (imported from XMonad.Layout.IndependentScreens),
‘workspaces’ (imported from XMonad),
‘W.workspaces’ (imported from XMonad.StackSet)
|
447 | onWorkspaces (workspacesOn 0) myLayout $
| ^^^^^^^^^^^^
xmonad.hs:448:27: error:
• Variable not in scope: workspacesOn :: Integer -> [WorkspaceId]
• Perhaps you meant one of these:
‘workspaces'’ (imported from XMonad.Layout.IndependentScreens),
‘workspaces’ (imported from XMonad),
‘W.workspaces’ (imported from XMonad.StackSet)
|
448 | onWorkspaces (workspacesOn 1) verticalLayout
|
现在我很困惑,因为该函数在文档中,并且我清楚地包含了对 IndependantStreens 的引用,它在错误消息中
上面的代码有什么问题,我该如何让它工作?