将X11配置为两个显卡,三个头,两个Zaphodmode?

问题描述 投票:0回答:1

我的机器中有两个显卡:

00:02.0 VGA 兼容控制器:Intel Corporation RocketLake-S GT1 [UHD Graphics 730](修订版 04)

02:00.0 VGA 兼容控制器:NVIDIA Corporation GK107 [GeForce GT 1030](rev a1)

然后我有三个显示器。 Nvidia 卡具有 DVI 和 HDMI 输出。 Intel 有 HDMI 和 Display Port。

我将两台 Lenovo 显示器连接到 Nvidia,将一台 NEC 显示器连接到 Intel。

我不想使用 xinerama。为什么?因为当它让窗口从一个屏幕拖动到另一个屏幕时,这是我不想要的。我希望每个显示器都有自己的显示器。

我是 Zaphod 模式的长期用户,我已经爱上它了。

那么我需要进行什么样的配置才能获得双座、三座 头配置?我有两个键盘,两个鼠标?

请使用 xorg.conf!

我尝试使用loginctl,我尝试使用xdm和evilwm。 我必须从手机上使用 termux 登录来终止 xdm X 会话才能重新控制我的计算机。

x11 xorg
1个回答
0
投票

经过许多次的考验和磨难:

首先,我需要将 xorg.conf 分成两个文件以简化计算过程。 所以我创建了:

/etc/X11/xorg.conf-LENOVOS
 and
/etc/X11/xorg.conf-NEC

然后我将 /etc/X11/xdm/Xservers 文件更改为:

:0 local /usr/bin/X :0 vt8 -nolisten tcp -seat seat0 -keeptty -config /etc/X11/xorg.conf-LENOVOS
:1 local /usr/bin/X :1 vt7 -nolisten tcp -seat seat1 -keeptty -config /etc/X11/xorg.conf-NEC

使用“lspci | grep VGA”查询显卡的PCI总线ID,请参阅问题的输出。 lspci 向我展示了:

00:02.0  is Intel
02:00.0  in Nvidia

翻译为:

BusID "PCI:2:0:0" for the Nvidia
BusID "PCI:0:2:0" for the Intel

在 xorg.conf 文件中进行配置。

现在,您需要确定哪个键盘和哪个鼠标位于哪个端口上并连接到哪个座位。 使用“loginctl”来执行此操作。

loginctl seat-status seat0

将显示当前配置。您应该会发现显卡、鼠标和键盘都在 Seat0 下。

创建并分配给 Seat1:

我用过:

loginctl attach seat1 /sys/devices/pci0000:00/0000:00:02.0/drm/card0
loginctl attach seat1 /sys/devices/pci0000:00/0000:00:14.0/usb1/1-12
loginctl attach seat1 /sys/devices/pci0000:00/0000:00:14.0/usb1/1-5

找到识别键盘和鼠标的相关字符串后。第一个 loginctl 命令的busid 与Intel 卡匹配。您的号码/设备会有所不同。您需要摸索/摸索“loginctl Seat-Status Seat0”的输出才能找到它们。

然后..这是我的 xorg.conf 文件:

xorg.conf-联想:

:~# cat /etc/X11/xorg.conf-LENOVOS 
Section "Monitor"
        Identifier "LENOVO-LEFT"
EndSection


Section "Monitor"
        Identifier "LENOVO-RIGHT"
#       Option "PreferredMode" "1600x1200"
EndSection


Section "Device"
        Identifier "NVIDIA-DVI-D-1"
        Driver "nouveau"
        Option "DRI" "3"
        Option "ModeDebug" "Yes"
        #Option "Monitor-HDMI-4" "HDMI-4"
        Option "Monitor-HDMI-4" "LENOVO-RIGHT"
        Option "ZaphodHeads" "HDMI-4"
        Option "DDC" "Off"
        BusID  "PCI:2:0:0"
        Screen 1
        MatchSeat "seat0"
EndSection

Section "Device"
        Identifier "NVIDIA-HDMI-4"
        Driver "nouveau"
        Option "DRI" "3"
        Option "ModeDebug" "Yes"
        #Option "Monitor-DVI-D-1" "DVI-D-1"
        Option "Monitor-DVI-D-1" "LENOVO-LEFT"
        Option "ZaphodHeads" "DVI-D-1"
        Option "DDC" "Off"
        BusID  "PCI:2:0:0"
        Screen 0
        MatchSeat "seat0"
EndSection

Section "Screen"
        Identifier "LENOVO2"
        Monitor "LENOVO-RIGHT"
        Device "NVIDIA-HDMI-4"
        MatchSeat "seat0"
EndSection

Section "Screen"
        Identifier "LENOVO1"
        Monitor "LENOVO-LEFT"
        Device "NVIDIA-DVI-D-1"
        MatchSeat "seat0"
EndSection


Section "ServerLayout"
        # The Identifier is not really important but must be unique.
        Identifier      "seat0"

        Screen 0 "LENOVO2"
        Screen 1 "LENOVO1" RightOf "LENOVO2"
        Option "Xinerama"       "off"
        Option "Clone"  "off"

        # MatchSeat means this layout will only be used when the "-seat seat-1"
        # parameter is given to /usr/bin/X, which most display managers will do
        # automatically.
        MatchSeat       "seat0"
EndSection

xorg.conf-NEC:

Section "Monitor"
        Identifier "HDMI-2"
EndSection


Section "Device"
        Identifier "HDMI_INTEL"
        Driver "intel"
        Option "DRI" "3"
        Option "ModeDebug" "Yes"
        Option "HDMI-2"
        Option "DDC" "Off"
        BusID  "PCI:0:2:0"
        # XXX screen 0 comment out maybe
        Screen 0 
        MatchSeat "seat1"
EndSection

Section "Screen"
        Identifier "NEC"
        Monitor "HDMI-2"
        Device "HDMI_INTEL"
        MatchSeat "seat1"
EndSection


Section "ServerLayout"
        # The Identifier is not really important but must be unique.
        Identifier "seat1"

        # This controls which Screen section is used in the layout, which in turn
        # dictates which GPU and monitor will be used.  The numbers can be omitted
        # if only one Screen is used (normally the case unless you are combining
        # monitors from different video cards).
        Screen          0       "NEC"

        # MatchSeat means this layout will only be used when the "-seat seat-1"
        # parameter is given to /usr/bin/X, which most display managers will do
        # automatically.
        MatchSeat       "seat1"
EndSection

所有这些都完成了,然后发出“/etc/init.d/xdm start”命令。然后我必须使用两个键盘登录。

最后要从 Zaphodheads 访问 NEC 显示“:1”(“:0.0 和 :0.1”),请使用 x2x:

nohup x2x -to :1 -west -from :0 &

与邪恶wm 完美配合。因此,当我使用 CTRL-ALT-LEFTARROW 或 CTRL-ALT-RIGHTARROW 切换虚拟桌面时,只有当前聚焦的 Zaphodhead 会切换。有点像拥有 16 个虚拟桌面,每个 zaphod 头有 8 个。他们独立切换。 Xinerama 不可能做到这一点。

© www.soinside.com 2019 - 2024. All rights reserved.