JAL-3521 Adjusted wrapper shell script and .desktop file to cater for opening a file...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 8 Feb 2021 11:57:20 +0000 (11:57 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 8 Feb 2021 11:57:20 +0000 (11:57 +0000)
utils/debian/debian/jalview.desktop
utils/debian/debian/wrappers/jalview [new file with mode: 0755]
utils/debian/mime_types_for_debian.pl

index d4cc896..7cf0afb 100644 (file)
@@ -6,7 +6,7 @@ Comment=Multiple Sequence Alignment Editor
 Icon=jalview-icon
 Type=Application
 TryExec=jalview
-Exec=jalview -open %u
+Exec=jalview %u
 Terminal=false
 Categories=Science;Biology;
 Keywords=alignment;sequence;
diff --git a/utils/debian/debian/wrappers/jalview b/utils/debian/debian/wrappers/jalview
new file mode 100755 (executable)
index 0000000..4823bee
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+ARG1=$1
+
+# copy the debian default settings if no user jalview settings file exist
+if [ -n "${HOME}" -a \! -e ${HOME}/.jalview_properties ]; then
+  /bin/cp /etc/jalview_properties ${HOME}/.jalview_properties
+fi
+
+# check to see if $1 is set and is not start of other cli set args
+OPEN=""
+if [ -n "$ARG1" -a "$ARG1" = "${ARG1#-}" ]; then
+  # first argument exists and does not start with a "-"
+  OPEN="-open"
+fi
+  
+java -jar /usr/share/java/jalview.jar $OPEN "$@"
index 56fc037..d6c7bf9 100755 (executable)
@@ -233,7 +233,7 @@ Comment=Multiple Sequence Alignment Editor
 Icon=jalview-icon
 Type=Application
 TryExec=jalview
-Exec=jalview -open %u
+Exec=jalview %u
 Terminal=false
 Categories=Science;Biology;
 Keywords=alignment;sequence;