Blame docker-builder-data/build/script/packet/papagayong-appimage.files/launch.sh

369e6c
#!/bin/bash
369e6c
369e6c
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
369e6c
BASE_DIR=`dirname "$SCRIPT_DIR"`
369e6c
369e6c
export LD_LIBRARY_PATH="${BASE_DIR}/lib:${BASE_DIR}/lib64:$LD_LIBRARY_PATH"
369e6c
export XDG_DATA_DIRS="${BASE_DIR}/share:$XDG_DATA_DIRS:/usr/local/share/:/usr/share/"
369e6c
export GSETTINGS_SCHEMA_DIR="${BASE_DIR}/share/glib-2.0/schemas/"
369e6c
export PYTHONHOME=$BASE_DIR
e78b89
export FONTCONFIG_PATH=/etc/fonts
369e6c
369e6c
#sed "s?@ROOTDIR@/modules?${BASE_DIR}/lib/pango/1.6.0/modules?" < $ETC_DIR/pango/pango.modules.in > $USER_CONFIG_DIR/pango/pango.modules
369e6c
if [ -e ${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in ]; then
369e6c
	export GDK_PIXBUF_MODULE_FILE="${USER_CONFIG_DIR}/gdk-pixbuf.loaders"
369e6c
	sed "s?@ROOTDIR@/loaders?${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders?" < ${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in > $GDK_PIXBUF_MODULE_FILE
369e6c
fi
369e6c
369e6c
export APPIMAGE_ROOT="$BASE_DIR"
369e6c
if [ ! -z "$APPIMAGE_WORKDIR" ]; then
369e6c
	if ! cd "$APPIMAGE_WORKDIR"; then
369e6c
		echo "Cannot change directory to \"$APPIMAGE_WORKDIR\" (APPIMAGE_WORKDIR)"
369e6c
		exit 1
369e6c
	fi
369e6c
fi
369e6c
369e6c
if [ "$1" = "--appimage-exec" ]; then
369e6c
	if ! "${@:2}"; then
369e6c
		exit 1
369e6c
	fi
369e6c
elif [ -z "$2" ]; then
369e6c
	if ! "$BASE_DIR/bin/papagayong.wrapper" "$@"; then
369e6c
		exit 1
369e6c
	fi
369e6c
elif [ "$1" -eq "--remove-appimage-desktop-integration" ]; then
369e6c
	if ! "$BASE_DIR/bin/papagayong.wrapper" "$@"; then
369e6c
		exit 1
369e6c
	fi
369e6c
else
369e6c
	if ! "$BASE_DIR/bin/papagayong" "$@"; then
369e6c
		exit 1
369e6c
	fi
369e6c
fi