4 link=$(readlink -f "${0}")
6 [ -n "${link}" ] && path=$(dirname "${link}")
10 *dedicated*) mode="dedicated" ;;
14 case $(uname):$(uname -m) in
15 Linux:x86_64) arch="linux64" ;;
16 *) arch="local" ;; # Not pre-built but you can build your own
19 # prefer locally built binary if available (see: Makefile)
20 xonotic="xonotic-local-${mode}"
21 [ -x "$xonotic" ] || xonotic="xonotic-${arch}-${mode}"
22 echo "Executing: $xonotic ${*}"
24 set -- ./${xonotic} "${@}"
42 xserver="${VALUE%%/*}"
48 # now how do we execute it?
49 if [ -r ~/.xonotic/data/config.cfg ]; then
50 while read -r CMD KEY VALUE; do
56 done < ~/.xonotic/data/config.cfg
65 0:+vid_x11_display\ *)
66 setdisplay "${X#+vid_x11_display }"
81 echo "Not using display ':$xserver': evil characters"
89 # check for a listening X server on that socket
90 if netstat -nl | grep -F " /tmp/.X11-unix/X$xserver" >/dev/null; then
91 # X server already exists
92 export DISPLAY=:$xserver
93 prefix="DISPLAY=:$xserver "
94 msg=$msg$lf"- Running Xonotic on already existing display :$xserver"
96 set -- startx "$@" -fullscreen -- ":$xserver"
97 msg=$msg$lf"- Running Xonotic on a newly created X server :$xserver."
102 echo >&2 "Not using layout '$xlayout': evil characters"
106 set -- "$@" -layout "$xlayout"
107 msg=$msg$lf"- Using the ServerLayout section named $xlayout."
112 echo "X SERVER OVERRIDES IN EFFECT:$msg"
114 echo "Resulting command line:"
117 echo "To undo these overrides, edit ~/.xonotic/data/config.cfg and remove the line"
118 echo "starting with 'seta vid_x11_display'."
124 if which "$1" > /dev/null
128 echo "Could not find $1 to exec"
129 if [ "$arch" = "local" ]
131 printf "%b\n%b\n" "Xonotic does not currently provide pre-built $(uname):$(uname -m) builds, please compile one using make" \
132 "More info is available at \e[1;36mhttps://gitlab.com/xonotic/xonotic/-/wikis/Compiling\e[m"