File: AppRun

package info (click to toggle)
darktable 5.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,864 kB
  • sloc: ansic: 361,898; cpp: 102,446; xml: 19,813; lisp: 14,539; sh: 3,771; javascript: 3,264; perl: 1,925; python: 1,485; ruby: 975; makefile: 543; asm: 46; sql: 38; awk: 21
file content (30 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash

# The purpose of this custom AppRun script is to allow the user to specify
# which binary from the multi-binary AppImage to run. This can be done in
# one of two ways:
# - The binary name can be specified as the first command line argument.
# If there is a binary with that name inside the AppImage, it will be run
# instead of the default one.
# - The user can create a symlink to the AppImage file and run it via the
# symlink. If inside the AppImage there is a binary with a name that matches
# the symlink name, it will be launched instead of the default one.

HERE="$(dirname "$(readlink -f "${0}")")"

source "$HERE"/apprun-hooks/"linuxdeploy-plugin-gtk.sh"

if [[ ! -z $APPIMAGE ]] ; then
  BINARY_NAME=$(basename "$ARGV0")
  if [[ ! -z "$1" ]] && [[ -e "$HERE/usr/bin/$1" ]] ; then
    EXECFILE="$HERE/usr/bin/$1" ; shift
  elif [[ -e "$HERE/usr/bin/$BINARY_NAME" ]] ; then
    EXECFILE="$HERE/usr/bin/$BINARY_NAME"
  else
    EXECFILE="$HERE/usr/bin/darktable"
  fi
else
  EXECFILE="$HERE/usr/bin/darktable"
fi

exec "$EXECFILE" "$@"