X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=xonotic-linux-glx.sh;h=f516fa9bfe5c89b6d52144b2ae9f0e8147566f86;hp=5461a4cc196b5cfed3901c11907eb815a7c83b6f;hb=1e434bee7af23e6dfd2130a8eadd131e5da3d643;hpb=2ec7592650fe8ad01d877f7c6887d9f9dda143af diff --git a/xonotic-linux-glx.sh b/xonotic-linux-glx.sh deleted file mode 100755 index 5461a4cc..00000000 --- a/xonotic-linux-glx.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh - -path=`dirname "${0}"` -link=`readlink "${0}"` - -[ -n "${link}" ] && path=`dirname "${link}"` -cd "${path}" - -case "${0##*/}" in - *sdl*) mode="sdl" ;; - *) mode="glx" ;; -esac - -case "$(uname -m)" in - x86_64) arch="x86_64" ;; - *) arch="686" ;; -esac - -xonotic="xonotic-linux-${arch}-${mode}" - -set -- ./${xonotic} "${@}" - -xserver= -xlayout= - -setdisplay() -{ - VALUE=$1 - VALUE=${VALUE#\"} - VALUE=${VALUE%\"} - case "$VALUE" in - :*) - ;; - *) - VALUE=:$VALUE - ;; - esac - VALUE="$VALUE/" - xserver="${VALUE%%/*}" - xserver=${xserver#:} - xlayout=${VALUE#*/} - xlayout=${xlayout%/} -} - -# now how do we execute it? -if [ -r ~/.xonotic/data/config.cfg ]; then - while read -r CMD KEY VALUE; do - case "$CMD:$KEY" in - seta:vid_x11_display) - setdisplay "$VALUE" - ;; - esac - done < ~/.xonotic/data/config.cfg -fi - -m=0 -for X in "$@"; do - case "$m:$X" in - 0:+vid_x11_display) - m=1 - ;; - 0:+vid_x11_display\ *) - setdisplay "${X#+vid_x11_display }" - ;; - 1:*) - setdisplay "$X" - m=0 - ;; - *) - ;; - esac -done - -case "$xserver" in - '') - ;; - *[!0-9]*) - echo "Not using display ':$xserver': evil characters" - ;; - *) - msg= - lf=' -' - prefix= - - # check for a listening X server on that socket - if netstat -nl | grep -F " /tmp/.X11-unix/X$xserver" >/dev/null; then - # X server already exists - export DISPLAY=:$xserver - prefix="DISPLAY=:$xserver " - msg=$msg$lf"- Running Xonotic on already existing display :$xserver" - else - set -- startx "$@" -fullscreen -- ":$xserver" - msg=$msg$lf"- Running Xonotic on a newly created X server :$xserver." - case "$xlayout" in - '') - ;; - *[!A-Za-z0-9]*) - echo >&2 "Not using layout '$xlayout': evil characters" - xlayout= - ;; - *) - set -- "$@" -layout "$xlayout" - msg=$msg$lf"- Using the ServerLayout section named $xlayout." - ;; - esac - fi - - echo "X SERVER OVERRIDES IN EFFECT:$msg" - echo - echo "Resulting command line:" - echo " $prefix$*" - echo - echo "To undo these overrides, edit ~/.xonotic/data/config.cfg and remove the line" - echo "starting with 'seta vid_x11_display'." - echo - echo - ;; -esac - -exec "$@" diff --git a/xonotic-linux-glx.sh b/xonotic-linux-glx.sh new file mode 120000 index 00000000..f516fa9b --- /dev/null +++ b/xonotic-linux-glx.sh @@ -0,0 +1 @@ +xonotic-linux-sdl.sh \ No newline at end of file