Skip to content

Commit

Permalink
option --appimage-exec
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwarthog committed Nov 21, 2016
1 parent f969ccb commit abfde6a
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
@@ -0,0 +1,22 @@
#!/bin/bash

OLDDIR=`pwd`
cd `dirname "$0"`
SCRIPT_DIR=`pwd`
BASE_DIR=`dirname "$SCRIPT_DIR"`

export LD_LIBRARY_PATH="$BASE_DIR/lib:$BASE_DIR/lib/opentoonz:$BASE_DIR/lib64:$LD_LIBRARY_PATH"
export QT_XKB_CONFIG_ROOT=$QT_XKB_CONFIG_ROOT:/usr/local/share/X11/xkb:/usr/share/X11/xkb

if [ "$1" = "--appimage-exec" ]; then
if ! "${@:2}"; then
cd "$OLDDIR"
exit 1
fi
else
if ! "./launch-opentoonz.sh.wrapper" "$@"; then
cd "$OLDDIR"
exit 1
fi
fi
cd "$OLDDIR"
@@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
Name=OpenToonz
Exec=launch-opentoonz.sh.wrapper
Exec=launch-opentoonz-appimage.sh
Icon=opentoonz
Categories=Graphics
Expand Up @@ -12,6 +12,7 @@ pkinstall() {
mkdir -p "$APPDIR/usr/lib"
cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/AppRun" "$APPDIR/" || return 1
cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/desktopintegration" "$APPDIR/usr/bin/launch-opentoonz.sh.wrapper" || return 1
cp --remove-destination "$FILES_PACKET_DIR/launch-opentoonz-appimage.sh" "$APPDIR/usr/bin" || return 1
cp --remove-destination "$FILES_PACKET_DIR/opentoonz.desktop" "$APPDIR/" || return 1
cp --remove-destination "$FILES_PACKET_DIR/opentoonz.png" "$APPDIR/" || return 1

Expand Down
Expand Up @@ -5,9 +5,12 @@ SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
cd "$OLDDIR"
BASE_DIR=`dirname "$SCRIPT_DIR"`

export LD_LIBRARY_PATH="$BASE_DIR/lib:$BASE_DIR/lib64:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$BASE_DIR/lib:$BASE_DIR/lib/opentoonz:$BASE_DIR/lib64:$LD_LIBRARY_PATH"
export QT_XKB_CONFIG_ROOT=$QT_XKB_CONFIG_ROOT:/usr/local/share/X11/xkb:/usr/share/X11/xkb

cd "$BASE_DIR/bin"
./opentoonz "$@"
if ! ./opentoonz "$@"; then
cd "$OLDDIR"
exit 1
fi
cd "$OLDDIR"
Expand Up @@ -39,10 +39,21 @@ if [ -e ${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in ]; then
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
fi

if [ "$1" = "run" ]; then
"${@:2}"
cd "$BASE_DIR/bin"
if [ "$1" = "--appimage-exec" ]; then
if ! "${@:2}"; then
cd "$OLDDIR"
exit 1
fi
elif [ -z "$2" ]; then
"${BASE_DIR}/bin/synfigstudio.wrapper" "$@"
if ! "$BASE_DIR/bin/synfigstudio.wrapper" "$@"; then
cd "$OLDDIR"
exit 1
fi
else
"${BASE_DIR}/bin/synfig" "$@"
if ! "$BASE_DIR/bin/synfig" "$@"; then
cd "$OLDDIR"
exit 1
fi
fi
cd "$OLDDIR"

0 comments on commit abfde6a

Please sign in to comment.