diff --git a/sample-next-junest.sh b/sample-next-junest.sh index 2deded3..e9eec3f 100644 --- a/sample-next-junest.sh +++ b/sample-next-junest.sh @@ -87,6 +87,33 @@ cp -r ./.junest/usr/share/icons/hicolor/512x512/apps/*$ICON* ./ 2>/dev/null cp -r ./.junest/usr/share/icons/hicolor/scalable/apps/*$ICON* ./ 2>/dev/null cp -r ./.junest/usr/share/pixmaps/*$ICON* ./ 2>/dev/null +# TEST IF THE DESKTOP FILE AND THE ICON ARE IN THE ROOT OF THE FUTURE APPIMAGE (./*AppDir/*) +if test -f ./*.desktop; then + echo "The .desktop file is available in $APP.AppDir/" +else + if test -f ./.junest/usr/bin/$BIN; then + echo "No .desktop file available for $APP, creating a new one..." + cat <<-HEREDOC >> "./$APP.desktop" + [Desktop Entry] + Version=1.0 + Type=Application + Name=NAME + Comment= + Exec=BINARY + Icon=tux + Categories=Utility; + Terminal=true + StartupNotify=true + HEREDOC + sed -i "s#BINARY#$BIN#g" ./$APP.desktop + sed -i "s#Name=NAME#Name=$(echo $APP | tr a-z A-Z)#g" ./$APP.desktop + wget https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/favicon.ico -O ./tux.png + else + echo "No binary in path... aborting all the processes." + exit + fi +fi + # ...AND FINALLY CREATE THE APPRUN, IE THE MAIN SCRIPT TO RUN THE APPIMAGE! # EDIT THE FOLLOWING LINES IF YOU THINK SOME ENVIRONMENT VARIABLES ARE MISSING rm -R -f ./AppRun