Only set DISPLAY or WAYLAND_DISPLAY if actually running under
x11/wayland. This fixes latest kodi gbm refusing to start because
it thinks a window manager is active.
Also set the Nvidia-specific __GL_YIELD only when Nvidia drivers
are actually used and drop SDL_MOUSE_RELATIVE - kodi stopped using
SDL a long time ago.
Signed-off-by: Matthias Reichl <hias@horus.com>
The current stop timeout of 5 seconds is way too low and
leads to systemd frequently killing kodi while it's still
shutting down. This is really bad since it can potentially
lead to corrupted files or databases and should be avoided
at all costs.
eg plain kodi 18.4 setup with only pvr.hts installed takes
about 6 seconds to stop on RPi4.
Increase the stop timeout to 30 seconds to allow proper shutdown
on slower systems.
While that is still a lot lower than the 90 seconds
systemd default it should both be enough for very slow systems
and also for us and users to notice kodi issues - in which case
those issues have to be investigated.
Signed-off-by: Matthias Reichl <hias@horus.com>