![Gnome 3.26 は monitors.xml を尊重しません](https://rvso.com/image/1543346/Gnome%203.26%20%E3%81%AF%20monitors.xml%20%E3%82%92%E5%B0%8A%E9%87%8D%E3%81%97%E3%81%BE%E3%81%9B%E3%82%93.png)
私は 3 台のモニター (ミニ ディスプレイ ポート経由で 3 つの HDMI ハブに接続) を備えた Arch で Gnome-Shell 3.26 を使用しています。このハードウェア設定は、以前のバージョンのソフトウェアでは問題なく動作していました。
私が直面している問題は、Gnome-Shell が monitors.xml を尊重しないことです。gnome 設定インターフェースでディスプレイ設定を変更するだけで、新しい monitors.xml を生成できますが、gnome shell を再起動すると (alt-f2: r)、ディスプレイ構成が完全にリセットされます。
これは私の monitors.xml です:
<monitors version="2">
<configuration>
<logicalmonitor>
<x>3840</x>
<y>0</y>
<scale>1</scale>
<monitor>
<monitorspec>
<connector>DP-1-2</connector>
<vendor>ACI</vendor>
<product>ASUS VS228</product>
<serial>C7LMQS146415</serial>
</monitorspec>
<mode>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
</mode>
</monitor>
</logicalmonitor>
<logicalmonitor>
<x>1920</x>
<y>0</y>
<scale>1</scale>
<primary>yes</primary>
<monitor>
<monitorspec>
<connector>DP-1-1-2</connector>
<vendor>ACI</vendor>
<product>VX279</product>
<serial>ECLMRS015424</serial>
</monitorspec>
<mode>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
</mode>
</monitor>
</logicalmonitor>
<logicalmonitor>
<x>0</x>
<y>0</y>
<scale>1</scale>
<monitor>
<monitorspec>
<connector>DP-1-1-1</connector>
<vendor>ACI</vendor>
<product>ASUS VS228</product>
<serial>C9LMTF180907</serial>
</monitorspec>
<mode>
<width>1920</width>
<height>1080</height>
<rate>60</rate>
</mode>
</monitor>
</logicalmonitor>
<disabled>
<monitorspec>
<connector>eDP-1</connector>
<vendor>SDC</vendor>
<product>0x424a</product>
<serial>0x00000000</serial>
</monitorspec>
</disabled>
</configuration>
</monitors>
これは、xrandr -q | grep " connected"
eDP-1 connected (normal left inverted right x axis y axis)
DP-1-1-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 476mm x 268mm
DP-1-1-2 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
DP-1-2 connected 1920x1080+3840+0 (normal left inverted right x axis y axis) 476mm x 268mm
monitors.xml が尊重されないのはなぜですか? 何かがそれを上書きしている可能性がありますか?
答え1
この GNOME Shell 拡張機能はこの問題を修正するはずです:マルチモニターを修正
インストールがうまくいかない場合は、次の手順に従ってください。http://bernaerts.dyndns.org/linux/74-ubuntu/309-ubuntu-デュアルディスプレイモニターの位置が失われました(アーカイブされたコピー) では、monitors.xml ファイルを削除して、GNOME で再作成することを提案しています。
それでもうまくいかない場合は (私の場合は省電力後の Arch Linux で)、 をインストールしxorg-xrandr
、 を介してディスプレイを照会しxrandr
、以下を実行します。
xrandr --output <CON1> --pos 0x0 --output <CON2> --pos 1920x0 --output <CON3> --pos 3840x0
xrandr
たとえば、DVI-0
またはからの接続名はどこにありますか。(DP-1-2 など)DisplayPort-0
からの識別子も機能するかどうか、またはそれらが同じであるかどうかはわかりません。monitor.xml
上記のリンクではこれを自動化する方法も説明されていますが、リンクが切れた場合に備えてここにコピーします。
/usr/local/sbin/モニター位置の更新
#!/bin/bash
# -------------------------------------------------
# Get monitors configuration from monitor.xml and apply it for current user session.
# In case of multiple definitions in monitor.xml only first one is used.
#
# See http://bernaerts.dyndns.org/linux/74-ubuntu/309-ubuntu-dual-display-monitor-position-lost
# for instructions
#
# Parameters :
# $1 : waiting time in sec. before forcing configuration (optional)
#
# Revision history :
# 19/04/2014, V1.0 - Creation by N. Bernaerts
# 10/07/2014, V1.1 - Wait 5 seconds for X to fully initialize
# 01/09/2014, V1.2 - Correct NULL file bug (thanks to Ivan Harmady) and handle rotation
# 07/10/2014, V1.3 - Add monitors size and rate handling (idea from jescalante)
# 08/10/2014, V1.4 - Handle primary display parameter
# 08/12/2014, V1.5 - Waiting time in seconds becomes a parameter
# -------------------------------------------------
# monitor.xml path
MONITOR_XML="$HOME/.config/monitors.xml"
# get number of declared monitors
NUM=$(xmllint --xpath 'count(//monitors/configuration['1']/output)' $MONITOR_XML)
# loop thru declared monitors to create the command line parameters
for (( i=1; i<=$NUM; i++)); do
# get attributes of current monitor (name and x & y positions)
NAME=$(xmllint --xpath 'string(//monitors/configuration['1']/output['$i']/@name)' $MONITOR_XML 2>/dev/null)
POS_X=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/x/text()' $MONITOR_XML 2>/dev/null)
POS_Y=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/y/text()' $MONITOR_XML 2>/dev/null)
ROTATE=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/rotation/text()' $MONITOR_XML 2>/dev/null)
WIDTH=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/width/text()' $MONITOR_XML 2>/dev/null)
HEIGHT=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/height/text()' $MONITOR_XML 2>/dev/null)
RATE=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/rate/text()' $MONITOR_XML 2>/dev/null)
PRIMARY=$(xmllint --xpath '//monitors/configuration['1']/output['$i']/primary/text()' $MONITOR_XML 2>/dev/null)
# if position is defined for current monitor, add its position and orientation to command line parameters
[ -n "$POS_X" ] && PARAM_ARR=("${PARAM_ARR[@]}" "--output" "$NAME" "--pos" "${POS_X}x${POS_Y}" "--fbmm" "${WIDTH}x${HEIGHT}" "--rate" "$RATE" "--rotate" "$ROTATE")
# if monitor is defined as primary, adds it to command line parameters
[ "$PRIMARY" = "yes" ] && PARAM_ARR=("${PARAM_ARR[@]}" "--primary")
done
# if needed, wait for some seconds (for X to finish initialisation)
[ -n "$1" ] && sleep $1
# position all monitors
xrandr "${PARAM_ARR[@]}"
/usr/share/applications/update-monitor-position.desktop
[Desktop Entry]
Type=Application
Exec=update-monitor-position
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Update Monitors Position
Name=Update Monitors Position
Comment[en_US]=Force monitors position from monitor.xml
Comment=Force monitors position from monitor.xml
Icon=display
そして、update-monitor-position.desktopを実行します。スタートアップアプリケーションの設定。