blob: 5d2602c63e9d992eb0aca34d82acb3ae086c979c [file] [log] [blame]
[Unit]
Description=X11 sommelier at display %i
[Service]
Environment="DISPLAY_VAR=DISPLAY"
Environment="XCURSOR_SIZE_VAR=XCURSOR_SIZE"
Environment="SOMMELIER_SCALE=1.0"
# For Xwayland, the font paths are normally built into the Xwayland binary
# at build time. These paths are lifted from the xorg-server source package
# on Debian stretch. This is the value of the --with-default-font-path argument
# to the configure script.
# TODO(smbarber): Factor this out for different distros.
Environment="SOMMELIER_XFONT_PATH=/usr/share/fonts/X11/misc,\
/usr/share/fonts/X11/cyrillic,\
/usr/share/fonts/X11/100dpi/:unscaled,\
/usr/share/fonts/X11/75dpi/:unscaled,\
/usr/share/fonts/X11/Type1,\
/usr/share/fonts/X11/100dpi,\
/usr/share/fonts/X11/75dpi,\
built-ins"
Type=notify
ExecStartPre=/bin/sh -c \
"/usr/bin/test -c /dev/dri/renderD128 && \
/bin/systemctl --user set-environment \
SOMMELIER_DRM_DEVICE=/dev/dri/renderD128 \
SOMMELIER_GLAMOR=1; \
/bin/true"
ExecStart=/usr/bin/sommelier \
-X \
--x-display=%i \
--sd-notify="READY=1" \
--no-exit-with-child \
--x-auth=${HOME}/.Xauthority \
/bin/sh -c \
"systemctl --user set-environment ${DISPLAY_VAR}=$${DISPLAY}; \
systemctl --user set-environment ${XCURSOR_SIZE_VAR}=$${XCURSOR_SIZE}; \
systemctl --user import-environment SOMMELIER_VERSION; \
touch ${HOME}/.Xauthority; \
xauth -f ${HOME}/.Xauthority add ${HOST}:%i . $(xxd -l 16 -p /dev/urandom); \
. /etc/sommelierrc"
ExecStopPost=/opt/google/cros-containers/bin/guest_service_failure_notifier sommelier-x
Restart=always
[Install]
WantedBy=default.target
DefaultInstance=0