summarylogtreecommitdiffstats
path: root/starsector.sh
blob: e773b94bca3167f749844a87f3825719652de35c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

# Java 7 is the only version of Java supported by starsector.
JAVA7=/usr/lib/jvm/$(archlinux-java status | grep -m 1 java-7 | sed 's/^ *//')/bin
[ -d ${JAVA7} ] && export PATH=${JAVA7}:${PATH}

# fix for users of special IM modules
unset XMODIFIERS GTK_IM_MODULE QT_IM_MODULE
unset CLASSPATH

BASEPATH=~/.starsector
SAVEPATH=${BASEPATH}/saves
MODPATH=${BASEPATH}/mods
SCRPATH=${BASEPATH}/screenshots
LOGPATH=${BASEPATH}/

[ -d ${BASEPATH} ] || mkdir ${BASEPATH}
[ -d ${SAVEPATH} ] || mkdir ${SAVEPATH}
[ -d ${MODPATH}  ] || mkdir ${MODPATH}
[ -d ${SCRPATH}  ] || mkdir ${SCRPATH}

for jarfile in /usr/share/java/starsector/*.jar ; do
  CLASSPATH=${CLASSPATH}:${jarfile}
done

cd /usr/share/starsector
exec java -server \
  -XX:CompilerThreadPriority=1 \
  -XX:+CompilerThreadHintNoPreempt \
  -Djava.library.path=/usr/lib/starsector \
  -Xms512m -Xmx1024m -classpath ${CLASSPATH} \
  -Dcom.fs.starfarer.settings.paths.saves=${SAVEPATH} \
  -Dcom.fs.starfarer.settings.paths.screenshots=${SCRPATH} \
  -Dcom.fs.starfarer.settings.paths.mods=${MODPATH} \
  -Dcom.fs.starfarer.settings.paths.logs=${LOGPATH} \
  com.fs.starfarer.StarfarerLauncher
# vim:set ts=2 sw=2 et: