让Xmonad将多个监视器视为一个监视器

时间:2015-03-25 09:52:08

标签: xmonad

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

现在我遇到的问题是,通过DisplayPort 1.2与NVidia显卡连接的4k显示器显示为系统的两个显示器,每半个显示器一个显示器。我可以再次使用xrandr将它们组合在一起,但是xmonad仍将它们视为两个显示器,这意味着我不能在整个屏幕上放置一个窗口(浮动时除外)。

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

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)

但这似乎没有任何改变。

是否有配置选项?我也很乐意改变源代码,我的布局不会改变一段时间。

1 个答案:

答案 0 :(得分:3)

我通过使用选项覆盖名为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是否可行,所以我现在暂时打开这个问题。

相关问题