#!/bin/bash # An AppImage imported from the front end (AppImageManager), extracted once at import into # /opt/appimages/user//app # and started from there: proot has no FUSE to mount the image, and extracting it at every # start (APPIMAGE_EXTRACT_AND_RUN) would cost the whole image in /tmp each time. # bannerlator-appimage-run /opt/appimages/user/ [args...] set -u dir=${1:?usage: bannerlator-appimage-run [args...]} shift export APPDIR=$dir/app # APPIMAGE is left unset on purpose: with it an app believes it runs from an image file and offers # to add itself to the menu (DuckStation) or update the file in place - DroidDeck already does the # one, and there is no image file for the other. unset APPIMAGE export ARGV0=$(cat "$dir/name" 2>/dev/null || basename "$dir") if [ ! -x "$APPDIR/AppRun" ]; then echo "bannerlator-appimage-run: $APPDIR/AppRun is missing; import the AppImage again" >&2 exit 127 fi echo "== appimage $ARGV0 ($APPDIR)" cd "$APPDIR" || exit 1 exec "$APPDIR/AppRun" "$@"