From 102c4a5e44f17f965387d203f8274803104863b5 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 8 Feb 2021 11:57:20 +0000 Subject: [PATCH] JAL-3521 Adjusted wrapper shell script and .desktop file to cater for opening a file with or without -open arg --- utils/debian/debian/jalview.desktop | 2 +- utils/debian/debian/wrappers/jalview | 17 +++++++++++++++++ utils/debian/mime_types_for_debian.pl | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 utils/debian/debian/wrappers/jalview diff --git a/utils/debian/debian/jalview.desktop b/utils/debian/debian/jalview.desktop index d4cc896..7cf0afb 100644 --- a/utils/debian/debian/jalview.desktop +++ b/utils/debian/debian/jalview.desktop @@ -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 index 0000000..4823bee --- /dev/null +++ b/utils/debian/debian/wrappers/jalview @@ -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 "$@" diff --git a/utils/debian/mime_types_for_debian.pl b/utils/debian/mime_types_for_debian.pl index 9cbfc40..15e1ea1 100755 --- a/utils/debian/mime_types_for_debian.pl +++ b/utils/debian/mime_types_for_debian.pl @@ -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; -- 1.7.10.2