Add dummy screen on startup if no monitor is plugged in
This commit is contained in:
@@ -179,6 +179,7 @@ RUN \
|
||||
xserver-xorg-input-libinput \
|
||||
xserver-xorg-legacy \
|
||||
xserver-xorg-video-all \
|
||||
xserver-xorg-video-dummy \
|
||||
xvfb \
|
||||
&& \
|
||||
echo "**** Section cleanup ****" \
|
||||
|
||||
@@ -85,6 +85,13 @@ function configure_x_server {
|
||||
else
|
||||
echo "Leaving evdev inputs disabled"
|
||||
fi
|
||||
|
||||
monitor_connected=$(cat /sys/class/drm/card*/status | awk '/^connected/ { print $1; }' | head -n1)
|
||||
if [[ "X${monitor_connected}" == "X" ]]; then
|
||||
echo "No monitors connected. Installing dummy xorg.conf"
|
||||
# Use a dummy display input
|
||||
cp -fv /templates/xorg/xorg.dummy.conf /etc/X11/xorg.conf
|
||||
fi
|
||||
}
|
||||
|
||||
if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
|
||||
|
||||
21
overlay/templates/xorg/xorg.dummy.conf
Normal file
21
overlay/templates/xorg/xorg.dummy.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
Section "Device"
|
||||
Identifier "Configured Video Device"
|
||||
Driver "dummy"
|
||||
EndSection
|
||||
|
||||
Section "Monitor"
|
||||
Identifier "Configured Monitor"
|
||||
HorizSync 31.5-48.5
|
||||
VertRefresh 50-70
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "Default Screen"
|
||||
Monitor "Configured Monitor"
|
||||
Device "Configured Video Device"
|
||||
DefaultDepth 24
|
||||
SubSection "Display"
|
||||
Depth 24
|
||||
Modes "1600x900"
|
||||
EndSubSection
|
||||
EndSection
|
||||
Reference in New Issue
Block a user