From: Ben Soares Date: Mon, 8 Feb 2021 11:57:20 +0000 (+0000) Subject: JAL-3521 Adjusted wrapper shell script and .desktop file to cater for opening a file... X-Git-Tag: Release_2_11_1_4~9^2~4 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=110ab7e607842e2514d7c40751cb8ac7f2b4c1cb;p=jalview.git JAL-3521 Adjusted wrapper shell script and .desktop file to cater for opening a file with or without -open arg --- 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 56fc037..d6c7bf9 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;