我有 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 的參考,它在錯誤訊息中
上面的代碼有什么問題,我該如何讓它作業?
uj5u.com熱心網友回復:
在您的配置中的某處,您撰寫了如下內容:
workspaces = withScreens 2 ["a", "b", "c"]
您可以使用 獲取特定螢屏上的作業區串列marshall。螢屏 0 上的作業區map (marshall 0) ["a", "b", "c"]與螢屏 1上的作業區類似。您可能應該將虛擬作業區串列分離到其自己的定義中。所以:
virtualWorkspaces = ["a", "b", "c"]
... (map (marshall 0) virtualWorkspaces) ...
... (map (marshall 1) virtualWorkspaces) ...
...
workspaces = withScreens 2 virtualWorkspaces
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/387005.html
