X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=xonotic-linux-glx.sh;h=137fc4ed27bacc5f4db5b82600047fa4a4f89989;hp=5461a4cc196b5cfed3901c11907eb815a7c83b6f;hb=883e2b54db7e05149fcd5d4cfcf40ebd7181b29e;hpb=2ec7592650fe8ad01d877f7c6887d9f9dda143af diff --git a/xonotic-linux-glx.sh b/xonotic-linux-glx.sh index 5461a4cc..137fc4ed 100755 --- a/xonotic-linux-glx.sh +++ b/xonotic-linux-glx.sh @@ -1,22 +1,23 @@ #!/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 case "$(uname -m)" in - x86_64) arch="x86_64" ;; - *) arch="686" ;; + i?86) arch="linux32" ;; # Not supported anymore but you can build your own. + *) arch="linux64" ;; esac -xonotic="xonotic-linux-${arch}-${mode}" +xonotic="xonotic-${arch}-${mode}" set -- ./${xonotic} "${@}" @@ -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 "$@"