Add dummy screen on startup if no monitor is plugged in

This commit is contained in:
Josh.5
2022-10-09 13:56:53 +13:00
committed by Josh Sunnex
parent 54e4e09d29
commit 3b9311fde3
3 changed files with 29 additions and 0 deletions

View File

@@ -179,6 +179,7 @@ RUN \
xserver-xorg-input-libinput \
xserver-xorg-legacy \
xserver-xorg-video-all \
xserver-xorg-video-dummy \
xvfb \
&& \
echo "**** Section cleanup ****" \

View File

@@ -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

View 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