X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=xonotic-linux-glx.sh;h=4ef3d03030318a37fe05ba54b6ae3a3a62b56bfd;hp=020970497116e080a5a0946a88473139f953b8cd;hb=8d73b1dcef03cb43c24244c62a72c44e415be067;hpb=6cbc3a19b806847a2d4510306e2943ad48bd5e94 diff --git a/xonotic-linux-glx.sh b/xonotic-linux-glx.sh index 02097049..4ef3d030 100755 --- a/xonotic-linux-glx.sh +++ b/xonotic-linux-glx.sh @@ -1,12 +1,13 @@ #!/bin/sh path=`dirname "${0}"` -link=`readlink "${0}"` +link=`readlink -f "${0}"` [ -n "${link}" ] && path=`dirname "${link}"` cd "${path}" case "${0##*/}" in + *dedicated*) mode="dedicated" ;; *sdl*) mode="sdl" ;; *) mode="glx" ;; esac @@ -118,4 +119,13 @@ case "$xserver" in ;; esac +# if pulseaudio +if [ -z "$SDL_AUDIODRIVER" ]; then + if ps -C pulseaudio >/dev/null; then + if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then + export SDL_AUDIODRIVER=pulse + fi + fi +fi + exec "$@"