From 5306a4b7e43c9597c5980f517ba73665a4832aab Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Sun, 1 May 2022 19:04:53 +0200 Subject: [PATCH] "AM" 3.0.5 RELEASED! Added template for AppImage, DEB, ZIP and TAR.BZ2 / TAR.GZ / TAR.XZ packages downloadable from Arch User Repository (AUR). I've merged the four templates for the applications from github.com into one script, so I've reduced the number of options from the option `-t` or `template`. --- APP-MANAGER | 116 +++++++++++++++++----------------------------------- 1 file changed, 38 insertions(+), 78 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index f47f4810a..4473f5c63 100644 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -450,12 +450,10 @@ case "$1" in ' echo ' 0) APPIMAGE updatable with "appimageupdatetool"' | tr a-z A-Z echo ' 1) APPIMAGE updatable using a separated zsync file' | tr a-z A-Z - echo " 2) APPIMAGE from github.com (always updatable)" | tr a-z A-Z - echo ' 3) DEB package from github.com (always updatable)' | tr a-z A-Z - echo ' 4) TAR archive from github.com (always updatable)' | tr a-z A-Z - echo ' 5) ZIP archive from github.com (always updatable)' | tr a-z A-Z - echo " 6) APPIMAGE, build your own with pkg2appimage and appimagetool" | tr a-z A-Z - echo " 7) APPIMAGE, build your own with pkg2appimage using a custom AppRun" | tr a-z A-Z + echo " 2) APPIMAGE/deb/tar/zip ARCHIVE from github.com (always updatable)" | tr a-z A-Z + echo " 3) APPIMAGE/deb/tar/zip ARCHIVE from AUR (always updatable)" | tr a-z A-Z + echo " 4) APPIMAGE, build your own with pkg2appimage and appimagetool" | tr a-z A-Z + echo " 5) APPIMAGE, build your own with pkg2appimage using a custom AppRun" | tr a-z A-Z echo " " read -r -p " WHAT KIND OF PROGRAM DO YOU WANT TO WRITE A SCRIPT FOR? : " response case "$response" in @@ -467,7 +465,7 @@ case "$1" in echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: " >> ./am-scripts/ABOUT/$arg && echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list; echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts " ;; - 2) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-GitHub-generic-appimage -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && + 2) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-GitHub-generic -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && echo "-----------------------------------------------------------------------"; read -r -p " ◆ ADD THE NAME OF THE REPOSITORY (EXAMPLE 'NAME/REPOSITORY') https://github.com/" RESPONSE @@ -475,7 +473,7 @@ case "$1" in *) sed -i s#REPLACETHIS#$RESPONSE#g ./am-scripts/$arch/$arg COMMENT=$(curl https://api.github.com/repos/$RESPONSE 2>/dev/null | grep description | sed 's/"description": "//' | sed 's/",//') echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: https://github.com/$RESPONSE" >> ./am-scripts/ABOUT/$arg && - echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list + echo "◆ $arg : $COMMENT" >> ./am-scripts/list esac echo " LIST OF CATEGORIES:"; echo ""; echo " 0) AudioVideo"; echo " 1) Audio"; echo " 2) Video"; echo " 3) Development"; echo " 4) Education"; echo " 5) Game"; echo " 6) Graphics"; echo " 7) Network"; echo " 8) Office"; echo " 9) Science"; echo " 10) Settings"; echo " 11) System"; echo " 12) Utility (default)"; echo ""; @@ -487,33 +485,16 @@ case "$1" in 12|*) sed -i s/YOURCATEGORY/Utility/g ./am-scripts/$arch/$arg;; esac echo "-----------------------------------------------------------------------"; - read -r -p " ◆ COPY/PASTE THE URL OF THE ICON HERE - URL: " RESPONSE + read -r -p " ◆ CHOOSE A FILE EXTENSION, IE + APPIMAGE (1), DEB (2), TAR.BZ2 (3), TAR.GZ (4), TAR.XZ (5) OR ZIP (6): " RESPONSE case "$RESPONSE" in - *) sed -i s#YOURICONURL#$RESPONSE#g ./am-scripts/$arch/$arg - esac - echo "-----------------------------------------------------------------------"; - echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts - " ;; - 3) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-GitHub-generic-deb -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && - echo "-----------------------------------------------------------------------"; - read -r -p " ◆ ADD THE NAME OF THE REPOSITORY (EXAMPLE 'NAME/REPOSITORY') - https://github.com/" RESPONSE - case "$RESPONSE" in - *) sed -i s#REPLACETHIS#$RESPONSE#g ./am-scripts/$arch/$arg - COMMENT=$(curl https://api.github.com/repos/$RESPONSE 2>/dev/null | grep description | sed 's/"description": "//' | sed 's/",//') - echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: https://github.com/$RESPONSE" >> ./am-scripts/ABOUT/$arg && - echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list - esac - echo " LIST OF CATEGORIES:"; echo ""; echo " 0) AudioVideo"; echo " 1) Audio"; echo " 2) Video"; echo " 3) Development"; echo " 4) Education"; echo " 5) Game"; - echo " 6) Graphics"; echo " 7) Network"; echo " 8) Office"; echo " 9) Science"; echo " 10) Settings"; echo " 11) System"; echo " 12) Utility (default)"; echo ""; - read -r -p " CHOOSE A CATEGORY : " response - case "$response" in - 0) sed -i s/YOURCATEGORY/AudioVideo/g ./am-scripts/$arch/$arg;; 1) sed -i s/YOURCATEGORY/Audio/g ./am-scripts/$arch/$arg;; 2) sed -i s/YOURCATEGORY/Video/g ./am-scripts/$arch/$arg;; 3) sed -i s/YOURCATEGORY/Development/g ./am-scripts/$arch/$arg;; - 4) sed -i s/YOURCATEGORY/Education/g ./am-scripts/$arch/$arg;; 5) sed -i s/YOURCATEGORY/Game/g ./am-scripts/$arch/$arg;; 6) sed -i s/YOURCATEGORY/Graphics/g ./am-scripts/$arch/$arg;; 7) sed -i s/YOURCATEGORY/Network/g ./am-scripts/$arch/$arg;; - 8) sed -i s/YOURCATEGORY/Office/g ./am-scripts/$arch/$arg;; 9) sed -i s/YOURCATEGORY/Science/g ./am-scripts/$arch/$arg;; 10) sed -i s/YOURCATEGORY/Settings/g ./am-scripts/$arch/$arg;; 11) sed -i s/YOURCATEGORY/System/g ./am-scripts/$arch/$arg;; - 12|*) sed -i s/YOURCATEGORY/Utility/g ./am-scripts/$arch/$arg;; - esac + 1) sed -i s/NAMETHATEXTENSION/AppImage/g ./am-scripts/$arch/$arg;; + 2) sed -i s/NAMETHATEXTENSION/deb/g ./am-scripts/$arch/$arg;; + 3) sed -i s/NAMETHATEXTENSION/tar.bz2/g ./am-scripts/$arch/$arg;; + 4) sed -i s/NAMETHATEXTENSION/tar.gz/g ./am-scripts/$arch/$arg;; + 5) sed -i s/NAMETHATEXTENSION/tar.xz/g ./am-scripts/$arch/$arg;; + 6) sed -i s/NAMETHATEXTENSION/zip/g ./am-scripts/$arch/$arg;; + esac echo "-----------------------------------------------------------------------"; read -r -p " ◆ COPY/PASTE THE URL OF THE ICON HERE URL: " RESPONSE @@ -522,7 +503,8 @@ case "$1" in esac echo "-----------------------------------------------------------------------"; read -r -p " ◆ ADD A PATH FOR THE EXTRACTED BINARY INTO THE ARCHIVE, - FOR EXAMPLE 'opt/$arg' OR 'usr/share/$arg' + FOR EXAMPLE 'opt/$arg' OR 'usr/share/$arg' + (LEAVE BLANK IF YOU MANAGE APPIMAGES OR ZIP PACKAGES) PATH/TO/FILES/IN/THE/ARCHIVE: " RESPONSE case "$RESPONSE" in *) sed -i s#PATHTOAPP#$RESPONSE#g ./am-scripts/$arch/$arg @@ -530,15 +512,16 @@ case "$1" in echo "-----------------------------------------------------------------------"; echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts " ;; - 4) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-GitHub-generic-tar -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && + + 3) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-AUR-generic -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && echo "-----------------------------------------------------------------------"; - read -r -p " ◆ ADD THE NAME OF THE REPOSITORY (EXAMPLE 'NAME/REPOSITORY') - https://github.com/" RESPONSE + read -r -p " ◆ NAME OF THE APP: " RESPONSE case "$RESPONSE" in - *) sed -i s#REPLACETHIS#$RESPONSE#g ./am-scripts/$arch/$arg - COMMENT=$(curl https://api.github.com/repos/$RESPONSE 2>/dev/null | grep description | sed 's/"description": "//' | sed 's/",//') - echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: https://github.com/$RESPONSE" >> ./am-scripts/ABOUT/$arg && - echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list + *) sed -i s#NAMETHATAPP#$RESPONSE#g ./am-scripts/$arch/$arg + COMMENT=$(wget -q https://aur.archlinux.org/packages/$arg -O - | grep -A1 Description | tail -1 | cut -c 30- | rev | cut -c 6- | rev) + UPSTREAMURL=$(wget -q https://aur.archlinux.org/packages/$arg -O - | grep -A3 Upstream | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | head -1) + echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: $UPSTREAMURL" >> ./am-scripts/ABOUT/$arg && + echo "◆ $arg : $COMMENT" >> ./am-scripts/list esac echo " LIST OF CATEGORIES:"; echo ""; echo " 0) AudioVideo"; echo " 1) Audio"; echo " 2) Video"; echo " 3) Development"; echo " 4) Education"; echo " 5) Game"; echo " 6) Graphics"; echo " 7) Network"; echo " 8) Office"; echo " 9) Science"; echo " 10) Settings"; echo " 11) System"; echo " 12) Utility (default)"; echo ""; @@ -550,41 +533,17 @@ case "$1" in 12|*) sed -i s/YOURCATEGORY/Utility/g ./am-scripts/$arch/$arg;; esac echo "-----------------------------------------------------------------------"; - read -r -p " ◆ COPY/PASTE THE URL OF THE ICON HERE - URL: " RESPONSE + read -r -p " ◆ CHOOSE A FILE EXTENSION, IE + APPIMAGE (1), DEB (2), TAR.BZ2 (3), TAR.GZ (4), TAR.XZ (5) OR ZIP (6): " RESPONSE case "$RESPONSE" in - *) sed -i s#YOURICONURL#$RESPONSE#g ./am-scripts/$arch/$arg - esac - echo "-----------------------------------------------------------------------"; - read -r -p " ◆ ADD A PATH FOR THE EXTRACTED BINARY INTO THE ARCHIVE, - FOR EXAMPLE 'opt/$arg' OR 'usr/share/$arg' - PATH/TO/FILES/IN/THE/ARCHIVE: " RESPONSE - case "$RESPONSE" in - *) sed -i s#PATHTOAPP#$RESPONSE#g ./am-scripts/$arch/$arg + 1) sed -i s/NAMETHATEXTENSION/AppImage/g ./am-scripts/$arch/$arg;; + 2) sed -i s/NAMETHATEXTENSION/deb/g ./am-scripts/$arch/$arg;; + 3) sed -i s/NAMETHATEXTENSION/tar.bz2/g ./am-scripts/$arch/$arg;; + 4) sed -i s/NAMETHATEXTENSION/tar.gz/g ./am-scripts/$arch/$arg;; + 5) sed -i s/NAMETHATEXTENSION/tar.xz/g ./am-scripts/$arch/$arg;; + 6) sed -i s/NAMETHATEXTENSION/zip/g ./am-scripts/$arch/$arg;; esac echo "-----------------------------------------------------------------------"; - echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts - " ;; - 5) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-GitHub-generic-zip -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && - echo "-----------------------------------------------------------------------"; - read -r -p " ◆ ADD THE NAME OF THE REPOSITORY (EXAMPLE 'NAME/REPOSITORY') - https://github.com/" RESPONSE - case "$RESPONSE" in - *) sed -i s#REPLACETHIS#$RESPONSE#g ./am-scripts/$arch/$arg - COMMENT=$(curl https://api.github.com/repos/$RESPONSE 2>/dev/null | grep description | sed 's/"description": "//' | sed 's/",//') - echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: https://github.com/$RESPONSE" >> ./am-scripts/ABOUT/$arg && - echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list - esac - echo " LIST OF CATEGORIES:"; echo ""; echo " 0) AudioVideo"; echo " 1) Audio"; echo " 2) Video"; echo " 3) Development"; echo " 4) Education"; echo " 5) Game"; - echo " 6) Graphics"; echo " 7) Network"; echo " 8) Office"; echo " 9) Science"; echo " 10) Settings"; echo " 11) System"; echo " 12) Utility (default)"; echo ""; - read -r -p " CHOOSE A CATEGORY : " response - case "$response" in - 0) sed -i s/YOURCATEGORY/AudioVideo/g ./am-scripts/$arch/$arg;; 1) sed -i s/YOURCATEGORY/Audio/g ./am-scripts/$arch/$arg;; 2) sed -i s/YOURCATEGORY/Video/g ./am-scripts/$arch/$arg;; 3) sed -i s/YOURCATEGORY/Development/g ./am-scripts/$arch/$arg;; - 4) sed -i s/YOURCATEGORY/Education/g ./am-scripts/$arch/$arg;; 5) sed -i s/YOURCATEGORY/Game/g ./am-scripts/$arch/$arg;; 6) sed -i s/YOURCATEGORY/Graphics/g ./am-scripts/$arch/$arg;; 7) sed -i s/YOURCATEGORY/Network/g ./am-scripts/$arch/$arg;; - 8) sed -i s/YOURCATEGORY/Office/g ./am-scripts/$arch/$arg;; 9) sed -i s/YOURCATEGORY/Science/g ./am-scripts/$arch/$arg;; 10) sed -i s/YOURCATEGORY/Settings/g ./am-scripts/$arch/$arg;; 11) sed -i s/YOURCATEGORY/System/g ./am-scripts/$arch/$arg;; - 12|*) sed -i s/YOURCATEGORY/Utility/g ./am-scripts/$arch/$arg;; - esac - echo "-----------------------------------------------------------------------"; read -r -p " ◆ COPY/PASTE THE URL OF THE ICON HERE URL: " RESPONSE case "$RESPONSE" in @@ -592,7 +551,8 @@ case "$1" in esac echo "-----------------------------------------------------------------------"; read -r -p " ◆ ADD A PATH FOR THE EXTRACTED BINARY INTO THE ARCHIVE, - FOR EXAMPLE 'opt/$arg' OR 'usr/share/$arg' + FOR EXAMPLE 'opt/$arg' OR 'usr/share/$arg' + (LEAVE BLANK IF YOU MANAGE APPIMAGES OR ZIP PACKAGES) PATH/TO/FILES/IN/THE/ARCHIVE: " RESPONSE case "$RESPONSE" in *) sed -i s#PATHTOAPP#$RESPONSE#g ./am-scripts/$arch/$arg @@ -600,11 +560,11 @@ case "$1" in echo "-----------------------------------------------------------------------"; echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts " ;; - 6) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-pkg2appimage -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && + 4) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-pkg2appimage -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: " >> ./am-scripts/ABOUT/$arg && echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list; echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts " ;; - 7) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-pkg2appimage-custom -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && + 5) mkdir -p ./am-scripts ./am-scripts/$arch ./am-scripts/ABOUT && wget -c -q $URL/templates/AM-SAMPLE-pkg2appimage-custom -O ./am-scripts/$arch/$arg && sed -i s/SAMPLE/$arg/g ./am-scripts/$arch/$arg && echo " " >> ./am-scripts/ABOUT/$arg; echo " $COMMENT" >> ./am-scripts/ABOUT/$arg; echo " " >> ./am-scripts/ABOUT/$arg; echo " SITE: " >> ./am-scripts/ABOUT/$arg && echo '◆ '$arg' : '$COMMENT'' >> ./am-scripts/list; echo ""; echo " All files are saved in $(xdg-user-dir DESKTOP)/am-scripts " ;; @@ -745,6 +705,6 @@ case "$1" in fi done shift;; - 'version'|'-v'|'--version') echo "3.0.4-3";; + 'version'|'-v'|'--version') echo "3.0.5";; *) exec /opt/am/APP-MANAGER ;; esac