Wayland 如何识别哪个显示器是哪个?

Wayland 如何识别哪个显示器是哪个?

一段时间以来,我在桌面上运行了两个显示器设置。我最初设置了一个/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

问题是 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> 

我尝试将其放在/var/lib/gdm3/.config/etc/gdm3/ 等几个地方,但我所做的一切都没有改变(包括 gnome 设置/显示面板中屏幕上的数字)

那么如何更改此设置,以便 gdm 在我的主屏幕上显示自己 - 而且(理想情况下,但不是必需的)我可以更改显示器编号,以便主屏幕为 1,辅助屏幕为 2。

答案1

那么几年后,由于人们偶尔还会关心这个问题,我尝试总结一个答案。

为此我借鉴了Ask.fedoraproject.orgwiki.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

我确保每个监视器条目都包含一行带有<primary>yes</primary>或 的行<primary>false</primary>

相关内容