-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRUNME.hidpi
executable file
·33 lines (26 loc) · 1.95 KB
/
RUNME.hidpi
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
#!/bin/bash
# Script that works well on macbook host with ubuntu guest using "Use Unscaled HiDPI output".
# I.e. ubuntu thinks the screen is just super big, when in fact the pixels are super small.
# So, to compensate, we make controls bigger than the defaults.
# From printing getFont() of various components at runtime, I see that the defaults are:
# controlled by controlFont:
# JLabel,JButton: font is javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=12]
# controlled by userFont:
# JTextField: font is javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=plain,size=12]
java_args="-Dswing.plaf.metal.controlFont=Dialog-bold-20 -Dswing.plaf.metal.userFont=Dialog-20 -Dswing.plaf.metal.systemFont=Dialog-20 -Dswing.plaf.metal.smallFont=Dialog-100"
# Classpath separator.
# Cygwin: ';' only (I think)
# Linux: ':' only (openjdk-8 at least)
# Darwin: ':' only
# Darwin and Linux both have uname, so that's a good differentior from Cygwin.
# XXX hmm according to Makefile, cygwin does have uname, and it outputs "Cygwin"? so I'm not sure this will work. should use logic in Makefile probably.
uname && sep=':' || sep=';'
# If everything including com is in ShephardsPlayApplet.jar,
# then can run it standalone with no classpath
#exec java -Xmx10g $java_args -jar ShephardsPlayApplet.jar "$@"
# Have to do it this way if com is not in ShephardsPlayApplet.jar
#exec java -Xmx10g -classpath "ShephardsPlayApplet.jar${sep}donhatchsw.jar" $java_args ShephardsPlayApplet "$@"
# This way doesn't require jar to be made at all, just the class files
#exec java -Xmx10g -classpath ".${sep}donhatchsw.jar" $java_args ShephardsPlayApplet "$@"
# Requires neither jar nor donhatchsw to be made (note that we still *compile* out of donhatchsw.jar in current directory though... this is just useful for non-interface fixes or debugging in donhatchsw)
exec java -Xmx10g -classpath ".${sep}../donhatchsw" $java_args ShephardsPlayApplet "$@"