mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
23 lines
1.0 KiB
Bash
Executable File
23 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# An AppImage imported from the front end (AppImageManager), extracted once at import into
|
|
# /opt/appimages/user/<id>/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/<id> [args...]
|
|
set -u
|
|
dir=${1:?usage: bannerlator-appimage-run <imported AppImage directory> [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" "$@"
|