Refactor startup to not require files in /etc/skel/
This commit is contained in:
20
config/X11/Xsession.d/60virtualgl
Normal file
20
config/X11/Xsession.d/60virtualgl
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "${VGL_DISPLAY-}" ]; then
|
||||
# Use the dummy X server if it is enabled
|
||||
if [ "${ENABLE_XDUMMY:?}" = 'true' ]; then
|
||||
export VGL_DISPLAY=:0.0
|
||||
else
|
||||
# Otherwise 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
|
||||
fi
|
||||
Reference in New Issue
Block a user