summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Alex2018-05-08 06:51:00 +1000
committerBen Alex2018-05-08 06:51:00 +1000
commit6c3bc49d4e0cc6b16c77080d357adafa584a595c (patch)
treec8830548fe0b115a2f740895d1f620fc856434d7
parent5611e2b4581889ea4e1cf265f34e81dd3fcd2dd7 (diff)
downloadaur-6c3bc49d4e0cc6b16c77080d357adafa584a595c.tar.gz
Allow user customisation of startup parameters
-rw-r--r--PKGBUILD15
-rwxr-xr-xib-gw8
-rw-r--r--ib-gw.conf14
-rwxr-xr-xib-tws9
-rw-r--r--ib-tws.conf15
5 files changed, 52 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7501aa29809..8a2cbe44b20 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,30 +1,35 @@
# Maintainer: Ben Alex <ben.alex@acegi.com.au>
+# Contributor: Jon Wiersma <archaur@jonw.org>
pkgname=ib-tws
pkgver=971.1
-pkgrel=1
+pkgrel=2
pkgdesc='Electronic trading platform from discount brokerage firm Interactive Brokers'
arch=('any')
url="http://interactivebrokers.com/"
license=('custom')
+backup=('etc/ib-tws.conf' 'etc/ib-gw.conf')
depends=(bash)
optdepends=(ffmpeg2.8)
makedepends=(gtk2 imagemagick unzip)
source=('LICENSE'
'ib-tws'
+ 'ib-tws.conf'
'ib-tws.desktop'
'ib-gw'
+ 'ib-gw.conf'
'ib-gw.desktop'
'https://download2.interactivebrokers.com/installers/tws/latest-standalone/tws-latest-standalone-linux-x64.sh')
md5sums=('e1cae2de592add7133bb08123e8db1ad'
- 'dff283b103c0ddeb76eba6ecfb852afd'
+ '428c553da90bb2ea650a7f96ae076937'
+ '1ec45ec225b8dcd362634f7395e8cd0d'
'9205b5eade96d69f8e470cc52c30db4a'
- '6f08b240afad921b29c2c81a440a6a8a'
+ 'b1cbe7273f3d0f2f0b6a09e65606b600'
+ '238637fb4ab6ae734bade474709bafb1'
'ffa9fcfb623850e5c9e796040bdbd052'
'ae2df5f73a2f519a417708ad97c33517')
-
build() {
cd ${srcdir}
chmod +x tws-latest-standalone-linux-x64.sh
@@ -59,6 +64,8 @@ package() {
install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}
install -Dm755 ib-gw ${pkgdir}/usr/bin/ib-gw
+ install -Dm644 ${pkgname}.conf ${pkgdir}/etc/$pkgname.conf
+ install -Dm644 ib-gw.conf ${pkgdir}/etc/ib-gw.conf
install -Dm644 ${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop
install -Dm644 ib-gw.desktop ${pkgdir}/usr/share/applications/ib-gw.desktop
mkdir -p ${pkgdir}/usr/share/pixmaps/
diff --git a/ib-gw b/ib-gw
index f66e779c2d2..41005558f7a 100755
--- a/ib-gw
+++ b/ib-gw
@@ -1,4 +1,8 @@
#!/bin/bash
-cd /usr/share/ib-tws/jars
-/usr/share/ib-tws/jre/bin/java -cp \* -Xmx512M -Dsun.java2d.noddraw=true ibgateway.GWClient $HOME/.ib-tws
+# Load system-wide settings and per-user overrides
+. /etc/ib-gw.conf
+[[ -f $HOME/.config/ib-gw.conf ]] && . $HOME/.config/ib-gw.conf
+
+cd /usr/share/ib-tws/jars
+/usr/share/ib-tws/jre/bin/java -cp \* $JAVA_FLAGS ibgateway.GWClient $IB_CONFIG_DIR
diff --git a/ib-gw.conf b/ib-gw.conf
new file mode 100644
index 00000000000..b4b58368252
--- /dev/null
+++ b/ib-gw.conf
@@ -0,0 +1,14 @@
+# System-wide config. To change these values per-user create a file at:
+# $HOME/.config/ib-gw.conf and set only the values you want to change there.
+#
+# In a per-user file you can also append to these flags like this:
+# ex: JAVA_UI_FLAGS="$JAVA_UI_FLAGS -Dsome_extra_flag"
+#
+# Or to the full set of JAVA_FLAGS like this:
+# ex: JAVA_FLAGS="$JAVA_FLAGS -SomeOtherFlag"
+
+IB_CONFIG_DIR=$HOME/.ib-tws
+JAVA_XMX="-Xmx512m"
+JAVA_UI_FLAGS="-Dsun.java2d.noddraw=true"
+JAVA_EXTRA_FLAGS=
+JAVA_FLAGS="$JAVA_XMX $JAVA_UI_FLAGS $JAVA_EXTRA_FLAGS"
diff --git a/ib-tws b/ib-tws
index 7d3161927d1..508588807b6 100755
--- a/ib-tws
+++ b/ib-tws
@@ -1,5 +1,8 @@
#!/bin/bash
+
+# Load system-wide settings and per-user overrides
+. /etc/ib-tws.conf
+[[ -f $HOME/.config/ib-tws.conf ]] && . $HOME/.config/ib-tws.conf
+
cd /usr/share/ib-tws/jars
-/usr/share/ib-tws/jre/bin/java -cp \* \
- -Xmx768m -Dsun.awt.nopixfmt=true -Dsun.java2d.noddraw=true -Dswing.boldMetal=false -Dsun.locale.formatasdefault=true \
- jclient.LoginFrame $HOME/.ib-tws
+/usr/share/ib-tws/jre/bin/java -cp \* $JAVA_FLAGS jclient.LoginFrame $IB_CONFIG_DIR
diff --git a/ib-tws.conf b/ib-tws.conf
new file mode 100644
index 00000000000..eb8152edd7f
--- /dev/null
+++ b/ib-tws.conf
@@ -0,0 +1,15 @@
+# System-wide config. To change these values per-user create a file at:
+# $HOME/.config/ib-tws.conf and set only the values you want to change there.
+#
+# In a per-user file you can also append to these flags like this:
+# ex: JAVA_UI_FLAGS="$JAVA_UI_FLAGS -Dsome_extra_flag"
+#
+# Or to the full set of JAVA_FLAGS like this:
+# ex: JAVA_FLAGS="$JAVA_FLAGS -SomeOtherFlag"
+
+IB_CONFIG_DIR=$HOME/.ib-tws
+JAVA_XMX="-Xmx768m"
+JAVA_UI_FLAGS="-Dsun.awt.nopixfmt=true -Dsun.java2d.noddraw=true -Dswing.boldMetal=false"
+JAVA_LOCALE_FLAGS="-Dsun.locale.formatasdefault=true"
+JAVA_EXTRA_FLAGS=
+JAVA_FLAGS="$JAVA_XMX $JAVA_UI_FLAGS $JAVA_LOCALE_FLAGS $JAVA_EXTRA_FLAGS"