一段时间以来,我在桌面上运行了两个显示器设置。我最初设置了一个/etc/X11/xorg.conf
文件来定义这些监视器。最近我的 17 英寸显示器出现故障(与 24 英寸显示器一起运行),由于替换的是 27 英寸,我想将新的 27 英寸显示器设为主屏幕,并将另一个移动到辅助屏幕。我创建了一个新/etc/X11/xorg.conf
文件,如下所示。
Section "Device"
Identifier "H67 Integrated Graphics"
Driver "intel"
Option "Monitor-HDMI2" "Iiyama 27in"
Option "Monitor-HDMI1" "Iiyama 24in"
EndSection
Section "Monitor"
Identifier "Iiyama 27in"
Option "DPMS"
Option "Primary"
Option "Position" "0 0"
Option "PreferredMode" "1920x1080"
EndSection
Section "Monitor"
Identifier "Iiyama 24in"
Option "DPMS"
Option "PreferredMode" "1920x1080"
Option "Position" "1920 0"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "H67 Integrated Graphics"
Monitor "Iiyama 27in"
DefaultDepth 24
Subsection "Display"
Depth 24
Modes "1920x1080" "1024x768" "640x480"
EndSubSection
EndSection
Run Code Online (Sandbox Code Playgroud)
问题是 gdm 以辅助监视器上的登录屏幕启动。此外,当我进入 gnome 本身的监视器布局时,它将辅助监视器标记为 1,将主要监视器标记为 2(尽管它确实将监视器 2 称为主要监视器,将监视器 1 称为辅助监视器)。
我已经看到建议我应该使用monitor.xml
我的主目录中的文件(在 下.config
),我接受了这个并修改了它,因此正确的监视器被定义为主要的,因此:-
<monitors version="1">
<configuration>
<clone>no</clone>
<output name="HDMI1">
<vendor>IVM</vendor>
<product>PLE2472HD</product>
<serial>1108511312415</serial>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
<x>1920</x>
<y>0</y>
<rotation>normal</rotation>
<reflect_x>no</reflect_x>
<reflect_y>no</reflect_y>
<primary>no</primary>
<presentation>no</presentation>
<underscanning>no</underscanning>
</output>
<output name="HDMI2">
<vendor>IVM</vendor>
<product>PLX2783H</product>
<serial>1128153703037</serial>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
<x>0</x>
<y>0</y>
<rotation>normal</rotation>
<reflect_x>no</reflect_x>
<reflect_y>no</reflect_y>
<primary>yes</primary>
<presentation>no</presentation>
<underscanning>no</underscanning>
</output>
</configuration>
</monitors>
Run Code Online (Sandbox Code Playgroud)
我试着把它放在几个地方,比如/var/lib/gdm3/.config
/etc/gdm3/,但我所做的一切都没有改变(包括 gnome 设置/显示面板中屏幕上的数字)
那么如何更改它以便 gdm 在我的主屏幕上显示自己 - 而且(理想情况下,但不是本质上)我可以更改监视器编号,以便主屏幕为 1,辅助屏幕为 2。
那么几年后,由于人们偶尔还会关心这个问题,我尝试总结一个答案。
为此,我利用了ask.fedoraproject.org和wiki.archlinux.org。
安全的一面是首先删除您自己的用户monitor.xml
文件(“如果您在 Wayland 下使用 GDM,您还必须使用在 Wayland 下创建的 Monitors.xml”,archlinux 告诉我们)。然后使用您首选的显示配置工具(我使用 gnome 设置)生成一个新的。
随后对我来说它基本上遵循
# cp ~/.config/monitors.xml /var/lib/gdm/.config/
# chown gdm:gdm /var/lib/gdm/.config/monitors.xml
Run Code Online (Sandbox Code Playgroud)
我确保每个监视器条目都包含一行带有 或 的<primary>yes</primary>
行<primary>false</primary>
。