Files
docker-xubuntu/config/X11/Xsession.d/60virtualgl
Héctor Molinero Fernández 4a45adaa58 Use dummy driver in headless Xorg
2025-06-21 13:49:26 +02:00

16 lines
391 B
Bash

#!/bin/sh
if [ -z "${VGL_DISPLAY-}" ]; then
# Try to use the EGL backend
for card in /dev/dri/card*; do
if /opt/VirtualGL/bin/eglinfo -B "${card:?}" 2>/dev/null; then
export VGL_DISPLAY="${card:?}"
break
fi
done
# And fallback to DISPLAY if the EGL backend is not available
if [ -z "${VGL_DISPLAY-}" ] && [ -n "${DISPLAY-}" ]; then
export VGL_DISPLAY="${DISPLAY:?}"
fi
fi