-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjws
executable file
·61 lines (52 loc) · 1.23 KB
/
jws
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# (c) 2020 Leif Sawyer
# License: GPL 3.0 (see https://github.com/akhepcat/)
# Permanent home: https://github.com/akhepcat/Miscellaneous/
# Direct download: https://raw.githubusercontent.com/akhepcat/Miscellaneous/master/jws
#
usage() {
echo "$(cd $HOME/jnlps/; ls *.jnlp | sed 's/\.jnlp//g')"
exit 1
}
if [ -z "$1" ]
then
echo "which java webstart pacakge?"
usage
else
JNLP=${1}
fi
JNLP=${JNLP//.jnlp/}
JNLP=${JNLP//.jws/}
if [ -e "$HOME/jnlps/${JNLP}.jnlp" ]
then
JWS="$HOME/jnlps/${JNLP}.jnlp"
elif [ -e "$HOME/jnlps/${JNLP}.jws" ]
then
JWS="$HOME/jnlps/${JNLP}.jws"
elif [ -e "${1}" ]
then
JWS="${1}"
else
echo "invalid java webstart package ${JNLP}"
usage
fi
# use one or more of these to work around java swing display corruption
# -Dsun.java2d.opengl=true
# -Dsun.java2d.d3d=false
# -Dsun.java2d.noddraw=true
#/usr/lib/jvm/java-7-oracle/jre/bin/
if [ -e "${HOME}/jnlps/javaws" ]
then
JWX="${HOME}/jnlps/javaws"
else
JWX="javaws" # system
fi
# -wait no longer works with OpenWebStart
OWS=$(DISPLAY=/dev/null javaws -Xnosplash -version 2>&1 | grep -i openwebstart)
if [ -n "${OWS}" ]
then
JARGS="-Xnosplash"
else
JARGS="-Xnosplash -wait"
fi
${JWX} -J"-Dsun.java2d.d3d=false" ${JARGS} "${JWS}"