probonopd | 4b45830 | 2017-11-09 19:32:56 +0100 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | # The purpose of this custom AppRun script is |
| 4 | # to allow symlinking the AppImage and invoking |
| 5 | # the corresponding binary depending on which |
| 6 | # symlink was used to invoke the AppImage |
| 7 | |
| 8 | HERE="$(dirname "$(readlink -f "${0}")")" |
| 9 | |
| 10 | export MAGICK_HOME="$HERE/usr" # http://www.imagemagick.org/QuickStart.txt |
| 11 | export MAGICK_CONFIGURE_PATH="$HERE/usr/lib/ImageMagick-7.0.7/config-Q16/" # Undocumented? |
| 12 | export MANPATH="$HERE/usr/share/man:$MANPATH" |
| 13 | export INFOPATH="$HERE/usr/share/info:$MANPATH" |
| 14 | |
| 15 | if [ "$1" == "man" ] ; then |
| 16 | shift ; exec "$@" ; exit $? |
| 17 | elif [ "$1" == "info" ] ; then |
| 18 | shift ; exec "$@" ; exit $? |
| 19 | fi |
| 20 | |
| 21 | if [ ! -z $APPIMAGE ] ; then |
| 22 | BINARY_NAME=$(basename "$ARGV0") |
| 23 | if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then |
| 24 | exec "$HERE/usr/bin/$BINARY_NAME" "$@" |
| 25 | else |
| 26 | exec "$HERE/usr/bin/magick" "$@" |
| 27 | fi |
| 28 | else |
| 29 | exec "$HERE/usr/bin/magick" "$@" |
| 30 | fi |