5 # (we cannot follow symlinks here, since we
6 # link -sdl.sh and -dedicated.sh to -glx.sh)
7 #link=`readlink "${0}"`
8 #[ -n "${link}" ] && path=`dirname "${link}"`
13 *dedicated*) mode="dedicated" ;;
19 x86_64) arch="linux64" ;;
23 xonotic="xonotic-${arch}-${mode}"
25 set -- ./${xonotic} "${@}"
43 xserver="${VALUE%%/*}"
49 # now how do we execute it?
50 if [ -r ~/.xonotic/data/config.cfg ]; then
51 while read -r CMD KEY VALUE; do
57 done < ~/.xonotic/data/config.cfg
66 0:+vid_x11_display\ *)
67 setdisplay "${X#+vid_x11_display }"
82 echo "Not using display ':$xserver': evil characters"
90 # check for a listening X server on that socket
91 if netstat -nl | grep -F " /tmp/.X11-unix/X$xserver" >/dev/null; then
92 # X server already exists
93 export DISPLAY=:$xserver
94 prefix="DISPLAY=:$xserver "
95 msg=$msg$lf"- Running Xonotic on already existing display :$xserver"
97 set -- startx "$@" -fullscreen -- ":$xserver"
98 msg=$msg$lf"- Running Xonotic on a newly created X server :$xserver."
103 echo >&2 "Not using layout '$xlayout': evil characters"
107 set -- "$@" -layout "$xlayout"
108 msg=$msg$lf"- Using the ServerLayout section named $xlayout."
113 echo "X SERVER OVERRIDES IN EFFECT:$msg"
115 echo "Resulting command line:"
118 echo "To undo these overrides, edit ~/.xonotic/data/config.cfg and remove the line"
119 echo "starting with 'seta vid_x11_display'."
126 if [ -z "$SDL_AUDIODRIVER" ]; then
127 if ps -C pulseaudio >/dev/null; then
128 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
129 export SDL_AUDIODRIVER=pulse