New Paste

 

Recent Pastes

Administrate




Pastebin on paste.luisaranguren.com

PasteID: u
Pasted by Anonymous, 2022-01-22 13:29:15 GMT
Expires Never
Paste size 2.49 Kb
Tools Raw   Download
 
  1. cat AppRun   
  2. #!/bin/bash  
  3. set -e  
  4.   
  5. if [ ! -z "$DEBUG" ] ; then  
  6.   env  
  7.   set -x  
  8. fi  
  9.   
  10. THIS="$0"  
  11. # http://stackoverflow.com/questions/3190818/  
  12. args=("$@")  
  13. NUMBER_OF_ARGS="$#"  
  14.   
  15. if [ -z "$APPDIR" ] ; then  
  16.   # Find the AppDir. It is the directory that contains AppRun.  
  17.   # This assumes that this script resides inside the AppDir or a subdirectory.  
  18.   # If this script is run inside an AppImage, then the AppImage runtime likely has already set $APPDIR  
  19.   path="$(dirname "$(readlink -f "${THIS}")")"  
  20.   while [[ "$path" != "" && ! -e "$path/$1" ]]; do  
  21.     path=${path%/*}  
  22.   done  
  23.   APPDIR="$path"  
  24. fi  
  25.   
  26. export PATH="${APPDIR}:${APPDIR}/usr/sbin:${PATH}"  
  27. export XDG_DATA_DIRS="./share/:/usr/share/gnome:/usr/local/share/:/usr/share/:${XDG_DATA_DIRS}"  
  28. export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"  
  29. export XDG_DATA_DIRS="${APPDIR}"/usr/share/:"${XDG_DATA_DIRS}":/usr/share/gnome/:/usr/local/share/:/usr/share/  
  30. export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"  
  31.   
  32. BIN="$APPDIR/trezor-suite"  
  33.   
  34. if [ -z "$APPIMAGE_EXIT_AFTER_INSTALL" ] ; then  
  35.   trap atexit EXIT  
  36. fi  
  37.   
  38. isEulaAccepted=1  
  39.   
  40. atexit()  
  41. {  
  42.   if [ $isEulaAccepted == 1 ] ; then  
  43.     if [ $NUMBER_OF_ARGS -eq 0 ] ; then  
  44.       exec "$BIN"  
  45.     else  
  46.       exec "$BIN" "${args[@]}"  
  47.     fi  
  48.   fi  
  49. }  
  50.   
  51. error()  
  52. {  
  53.   if [ -x /usr/bin/zenity ] ; then  
  54.     LD_LIBRARY_PATH="" zenity --error --text "${1}" 2>/dev/null  
  55.   elif [ -x /usr/bin/kdialog ] ; then  
  56.     LD_LIBRARY_PATH="" kdialog --msgbox "${1}" 2>/dev/null  
  57.   elif [ -x /usr/bin/Xdialog ] ; then  
  58.     LD_LIBRARY_PATH="" Xdialog --msgbox "${1}" 2>/dev/null  
  59.   else  
  60.     echo "${1}"  
  61.   fi  
  62.   exit 1  
  63. }  
  64.   
  65. yesno()  
  66. {  
  67.   TITLE=$1  
  68.   TEXT=$2  
  69.   if [ -x /usr/bin/zenity ] ; then  
  70.     LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2>/dev/null || exit 0  
  71.   elif [ -x /usr/bin/kdialog ] ; then  
  72.     LD_LIBRARY_PATH="" kdialog --title "$TITLE" --yesno "$TEXT" || exit 0  
  73.   elif [ -x /usr/bin/Xdialog ] ; then  
  74.     LD_LIBRARY_PATH="" Xdialog --title "$TITLE" --clear --yesno "$TEXT" 10 80 || exit 0  
  75.   else  
  76.     echo "zenity, kdialog, Xdialog missing. Skipping ${THIS}."  
  77.     exit 0  
  78.   fi  
  79. }  
  80.   
  81. check_dep()  
  82. {  
  83.   DEP=$1  
  84.   if [ -z $(which "$DEP") ] ; then  
  85.     echo "$DEP is missing. Skipping ${THIS}."  
  86.     exit 0  
  87.   fi  
  88. }  
  89.   
  90. if [ -z "$APPIMAGE" ] ; then  
  91.   APPIMAGE="$APPDIR/AppRun"  
  92.   # not running from within an AppImage; hence using the AppRun for Exec=  
  93. fi  
  94.   
  95.  

 
 

 
 
 
 
 
Written by Xan Manning, 2010.