4 link=$(readlink -f "${0}")
6 [ -n "${link}" ] && path=$(dirname "${link}")
10 *dedicated*) mode="dedicated" ;;
15 case $(uname):$(uname -m) in
16 Linux:x86_64) arch="linux64" ;;
17 *) arch="local" ;; # Not pre-built but you can build your own
20 # prefer locally built binary if available (see: Makefile)
21 xonotic="xonotic-local-${mode}"
22 [ -x "$xonotic" ] || xonotic="xonotic-${arch}-${mode}"
23 echo "Executing: $xonotic ${*}"
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'."
125 if which "$1" > /dev/null
129 echo "Could not find $1 to exec"
130 if [ "$arch" = "local" ]
132 printf "%b\n%b\n" "Xonotic does not currently provide pre-built $(uname):$(uname -m) builds, please compile one using make" \
133 "More info is available at \e[1;36mhttps://gitlab.com/xonotic/xonotic/-/wikis/Compiling\e[m"