gpt4 book ai didi

xmonad - 让 Xmonad 将多个显示器视为一个显示器

转载 作者:行者123 更新时间:2023-12-02 08:34:54 28 4
gpt4 key购买 nike

默认情况下,xmonad 处理 every display separately 。我可以切换到每个显示器并在其上放置一个工作区。这非常有效并且很有意义。

现在我遇到的问题是,通过 DisplayPort 1.2 与 NVidia 显卡连接的 4k 显示器在系统中呈现为两个显示器,每半个显示器对应一个显示器。我可以用 xrandr 将它们再次放在一起,但 xmonad 仍然将它们视为两个显示器,这意味着我无法将一个窗口放在整个屏幕上( float 时除外)。

我已经尝试更改 xmonad 源中 Operations.hs 中的 rescreen 方法,以始终返回固定布局,而不是系统返回的布局,但这改变了没有什么。详情:

ghc -e "Graphics.X11.openDisplay [] >>= Graphics.X11.Xinerama.getScreenInfo"

结果

  [Rectangle {rect_x = 4080, rect_y = 584, rect_width = 1920, rect_height = 2160}, -- D, DP-4.9
Rectangle {rect_x = 2160, rect_y = 584, rect_width = 1920, rect_height = 2160}, -- C, DP-4.8
Rectangle {rect_x = 0, rect_y = 1920, rect_width = 2160, rect_height = 1920}, -- B, DP-2.8
Rectangle {rect_x = 0, rect_y = 0, rect_width = 2160, rect_height = 1920}] -- A, DP-2.9

这与 xrandr 报告的布局相对应:

A
C D
B

C: DP-4.8 connected primary 1920x2160+4080+584 (normal left inverted right x axis y axis) 527mm x 296mm
D: DP-4.9 connected 1920x2160+2160+584 (normal left inverted right x axis y axis) 527mm x 296mm
B: DP-2.8 connected 2160x1920+0+1920 left (normal left inverted right x axis y axis) 527mm x 296mm
A: DP-2.9 connected 2160x1920+0+0 left (normal left inverted right x axis y axis) 527mm x 296mm

(为了清晰起见,我添加了物理布局)

我尝试为重屏功能提供固定的矩形布局,其中每个矩形覆盖显示屏的两侧:

myFixed = [Rectangle {rect_x = 2160, rect_y = 584, rect_width = 3840, rect_height = 2160}, -- C, D
Rectangle {rect_x = 0, rect_y = 0, rect_width = 2160, rect_height = 3840}] -- A, B

-- | Cleans the list of screens according to the rules documented for
-- nubScreens.
getCleanedScreenInfo :: MonadIO m => Display -> m [Rectangle]
getCleanedScreenInfo = io . fmap nubScreens . (const $ return myFixed)

但这似乎没有改变任何事情。

有相关的配置选项吗?我也很乐意更改源代码,我的布局暂时不会改变。

最佳答案

我通过使用名为 TwinViewXineramaInfoOverride 的选项来覆盖 nvidia 驱动程序提供的屏幕信息来解决该问题。这实现了我通过更改 XMonad 源尝试的结果。我的 xorg.conf 中的相关选项是:

 Option "TwinView"
Option "NoTwinViewXineramaInfo" "0"
Option "TwinViewXineramaInfoOverride" "2160x3840+0+0, 3840x2160+2160+584"
# explicitly tell which monitors are connected:
Option "ConnectedMonitor" "DFP-4.9, DFP-4.8, DFP-2.8, DFP-2.9"
Option "TwinViewOrientation" "RightOf"

我希望这可以帮助遇到同样问题的人。我仍然不知道通过配置 XMonad 是否可以实现这一点,所以我暂时保留这个问题。

关于xmonad - 让 Xmonad 将多个显示器视为一个显示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29252347/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com