-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
3,217 additions
and
5,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,74 @@ | ||
#!/bin/sh | ||
|
||
# AM INSTALL SCRIPT VERSION 3.5 | ||
set -u | ||
APP=fontlet | ||
REPO="fontlet/fontlet-explorer" | ||
SITE="fontlet/fontlet-explorer" | ||
|
||
# CREATE THE FOLDER | ||
mkdir /opt/$APP | ||
cd /opt/$APP | ||
# CREATE DIRECTORIES AND ADD REMOVER | ||
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1 | ||
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > ../remove | ||
printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove | ||
chmod a+x ../remove || exit 1 | ||
|
||
# ADD THE REMOVER | ||
echo '#!/bin/sh' >> /opt/$APP/remove | ||
echo "rm -R -f /usr/share/applications/AM-$APP.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove | ||
chmod a+x /opt/$APP/remove | ||
|
||
# DOWNLOAD THE ARCHIVE | ||
mkdir tmp | ||
cd ./tmp | ||
|
||
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | grep -w -v i386 | grep -w -v i686 | grep -w -v aarch64 | grep -w -v arm64 | grep -w -v armv7l | grep browser_download_url | grep -i appimage | cut -d '"' -f 4 | head -1) | ||
wget $version | ||
echo "$version" >> /opt/$APP/version | ||
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates | ||
version=$(curl -Ls https://api.github.com/repos/fontlet/fontlet-explorer/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386|i686|aarch64|arm64|armv7l" | head -1) | ||
wget "$version" || exit 1 | ||
#wget "$version.zsync" 2> /dev/null # Comment out this line if you want to use zsync | ||
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded. | ||
cd .. | ||
mv ./tmp/*mage ./$APP | ||
chmod a+x /opt/$APP/$APP | ||
rmdir ./tmp | ||
mv ./tmp/*mage ./"$APP" | ||
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null | ||
rm -R -f ./tmp || exit 1 | ||
echo "$version" > ./version | ||
chmod a+x ./"$APP" || exit 1 | ||
|
||
# LINK | ||
ln -s /opt/$APP/$APP /usr/local/bin/$APP | ||
# LINK TO PATH | ||
ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP" | ||
|
||
# SCRIPT TO UPDATE THE PROGRAM | ||
cat >> /opt/$APP/AM-updater << 'EOF' | ||
#!/usr/bin/env bash | ||
cat >> ./AM-updater << 'EOF' | ||
#!/bin/sh | ||
set -u | ||
APP=fontlet | ||
REPO="fontlet/fontlet-explorer" | ||
version0=$(cat /opt/$APP/version) | ||
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | grep -w -v i386 | grep -w -v i686 | grep -w -v aarch64 | grep -w -v arm64 | grep -w -v armv7l | grep browser_download_url | grep -i appimage | cut -d '"' -f 4 | head -1) | ||
if [ $version = $version0 ]; then | ||
echo "Update not needed!" | ||
else | ||
notify-send "A new version of $APP is available, please wait" | ||
mkdir /opt/$APP/tmp | ||
cd /opt/$APP/tmp | ||
wget $version | ||
if ls . | grep mage; then | ||
SITE="fontlet/fontlet-explorer" | ||
version0=$(cat "/opt/$APP/version") | ||
version=$(curl -Ls https://api.github.com/repos/fontlet/fontlet-explorer/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386|i686|aarch64|arm64|armv7l" | head -1) | ||
[ -n "$version" ] || { echo "Error getting link"; exit 1; } | ||
if [ "$version" != "$version0" ] || [ -e /opt/"$APP"/*.zsync ]; then | ||
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1 | ||
[ -e ../*.zsync ] || notify-send "A new version of $APP is available, please wait" | ||
[ -e ../*.zsync ] && wget "$version.zsync" 2>/dev/null || { wget "$version" || exit 1; } | ||
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded. | ||
cd .. | ||
if test -f ./tmp/*mage; then rm ./version | ||
fi | ||
echo $version >> ./version | ||
mv --backup=t ./tmp/*mage ./$APP | ||
chmod a+x /opt/$APP/$APP | ||
rm -R -f ./tmp ./*~ | ||
fi | ||
notify-send "$APP is updated!" | ||
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null || mv --backup=t ./tmp/*mage ./"$APP" | ||
[ -e ./*.zsync ] && { zsync ./"$APP".zsync || notify-send -u critical "zsync failed to update $APP"; } | ||
chmod a+x ./"$APP" || exit 1 | ||
echo "$version" > ./version | ||
rm -R -f ./*zs-old ./*.part ./tmp ./*~ | ||
notify-send "$APP is updated!" | ||
else | ||
echo "Update not needed!" | ||
fi | ||
EOF | ||
chmod a+x /opt/$APP/AM-updater | ||
chmod a+x ./AM-updater || exit 1 | ||
|
||
# LAUNCHER & ICON | ||
app=$(echo $APP | cut -c -3) | ||
cd /opt/$APP | ||
./$APP --appimage-extract *.desktop 1>/dev/null | ||
./$APP --appimage-extract share/applications/*.desktop 1>/dev/null | ||
./$APP --appimage-extract usr/share/applications/*.desktop 1>/dev/null | ||
mv squashfs-root/*.desktop ./$APP.desktop | ||
mv squashfs-root/share/applications/*.desktop ./$APP.desktop | ||
mv squashfs-root/usr/share/applications/*.desktop ./$APP.desktop | ||
if [ ! -e ./$APP.desktop ]; then | ||
rm ./$APP.desktop; ./$APP --appimage-extract usr/share/applications/*$app*.desktop | ||
mv squashfs-root/usr/share/applications/*.desktop ./$APP.desktop | ||
fi | ||
if [ ! -e ./$APP.desktop ]; then | ||
rm ./$APP.desktop; ./$APP --appimage-extract share/applications/*$app*.desktop 1>/dev/null | ||
mv squashfs-root/share/applications/*.desktop ./$APP.desktop | ||
fi | ||
CHANGEEXEC=$(cat ./$APP.desktop | grep Exec= | tr ' ' '\n' | tr '=' '\n' | tr '/' '\n' | grep $app | head -1) | ||
sed -i "s#$CHANGEEXEC#$APP#g" ./$APP.desktop | ||
sed -i "s#AppRun#$APP#g" ./$APP.desktop | ||
sed -i "s#Exec=/bin/#Exec=#g" ./$APP.desktop | ||
sed -i "s#Exec=/usr/bin/#Exec=#g" ./$APP.desktop | ||
CHANGEICON=$(cat ./$APP.desktop | grep Icon= | head -1) | ||
sed -i "s#$CHANGEICON#Icon=/opt/$APP/icons/$APP#g" ./$APP.desktop | ||
|
||
mkdir icons | ||
./$APP --appimage-extract *.png 2>&1 | grep -v "squashfs-root"; mv ./squashfs-root/*$app* ./icons/$APP 2>/dev/null | ||
./$APP --appimage-extract *.svg 2>&1 | grep -v "squashfs-root"; mv ./squashfs-root/*$app* ./icons/$APP 2>/dev/null | ||
./$APP --appimage-extract share/icons/*/*/* 1>/dev/null | ||
./$APP --appimage-extract usr/share/icons/*/*/* 1>/dev/null | ||
./$APP --appimage-extract share/icons/*/*/*/* 1>/dev/null | ||
./$APP --appimage-extract usr/share/icons/*/*/*/* 1>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/22x22/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/24x24/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/32x32/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/48x48/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/64x64/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/128x128/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/256x256/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/512x512/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/scalable/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/22x22/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/24x24/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/32x32/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/48x48/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/64x64/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/128x128/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/256x256/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/512x512/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/scalable/apps/*$app* ./icons/$APP 2>/dev/null | ||
|
||
rm -R -f /opt/$APP/squashfs-root | ||
mv ./$APP.desktop /usr/share/applications/AM-$APP.desktop | ||
|
||
|
||
|
||
|
||
./"$APP" --appimage-extract *.desktop 1>/dev/null && mv ./squashfs-root/*.desktop ./"$APP".desktop | ||
./"$APP" --appimage-extract .DirIcon 1>/dev/null && mv ./squashfs-root/.DirIcon ./DirIcon | ||
COUNT=0 | ||
while [ "$COUNT" -lt 10 ]; do # Tries to get the actual icon/desktop if it is a symlink to another symlink | ||
if [ -L ./"$APP".desktop ]; then | ||
LINKPATH="$(readlink ./"$APP".desktop | sed 's|^\./||' 2>/dev/null)" | ||
./"$APP" --appimage-extract "$LINKPATH" 1>/dev/null && mv ./squashfs-root/"$LINKPATH" ./"$APP".desktop | ||
fi | ||
if [ -L ./DirIcon ]; then | ||
LINKPATH="$(readlink ./DirIcon | sed 's|^\./||' 2>/dev/null)" | ||
./"$APP" --appimage-extract "$LINKPATH" 1>/dev/null && mv ./squashfs-root/"$LINKPATH" ./DirIcon | ||
fi | ||
[ ! -L ./"$APP".desktop ] && [ ! -L ./DirIcon ] && break | ||
COUNT=$((COUNT + 1)) | ||
done | ||
sed -i "s#Exec=[^ ]*#Exec=$APP#g; s#Icon=.*#Icon=/opt/$APP/icons/$APP#g" ./"$APP".desktop | ||
mv ./"$APP".desktop /usr/local/share/applications/"$APP"-AM.desktop && mv ./DirIcon ./icons/"$APP" 1>/dev/null | ||
rm -R -f ./squashfs-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,74 @@ | ||
#!/bin/sh | ||
|
||
# AM INSTALL SCRIPT VERSION 3.5 | ||
set -u | ||
APP=foobar2000 | ||
REPO="mmtrt/foobar2000_AppImage" | ||
SITE="mmtrt/foobar2000_AppImage" | ||
|
||
# CREATE THE FOLDER | ||
mkdir /opt/$APP | ||
cd /opt/$APP | ||
# CREATE DIRECTORIES AND ADD REMOVER | ||
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1 | ||
printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > ../remove | ||
printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove | ||
chmod a+x ../remove || exit 1 | ||
|
||
# ADD THE REMOVER | ||
echo '#!/bin/sh' >> /opt/$APP/remove | ||
echo "rm -R -f /usr/share/applications/AM-$APP.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove | ||
chmod a+x /opt/$APP/remove | ||
|
||
# DOWNLOAD THE ARCHIVE | ||
mkdir tmp | ||
cd ./tmp | ||
|
||
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | grep -w -v i386 | grep -w -v i686 | grep -w -v aarch64 | grep -w -v arm64 | grep -w -v armv7l | grep browser_download_url | grep -i appimage | cut -d '"' -f 4 | head -1) | ||
wget $version | ||
echo "$version" >> /opt/$APP/version | ||
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates | ||
version=$(curl -Ls https://api.github.com/repos/mmtrt/foobar2000_AppImage/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386|i686|aarch64|arm64|armv7l" | head -1) | ||
wget "$version" || exit 1 | ||
#wget "$version.zsync" 2> /dev/null # Comment out this line if you want to use zsync | ||
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded. | ||
cd .. | ||
mv ./tmp/*mage ./$APP | ||
chmod a+x /opt/$APP/$APP | ||
rmdir ./tmp | ||
mv ./tmp/*mage ./"$APP" | ||
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null | ||
rm -R -f ./tmp || exit 1 | ||
echo "$version" > ./version | ||
chmod a+x ./"$APP" || exit 1 | ||
|
||
# LINK | ||
ln -s /opt/$APP/$APP /usr/local/bin/$APP | ||
# LINK TO PATH | ||
ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP" | ||
|
||
# SCRIPT TO UPDATE THE PROGRAM | ||
cat >> /opt/$APP/AM-updater << 'EOF' | ||
#!/usr/bin/env bash | ||
cat >> ./AM-updater << 'EOF' | ||
#!/bin/sh | ||
set -u | ||
APP=foobar2000 | ||
REPO="mmtrt/foobar2000_AppImage" | ||
version0=$(cat /opt/$APP/version) | ||
version=$(curl -Ls https://api.github.com/repos/$REPO/releases | grep -w -v i386 | grep -w -v i686 | grep -w -v aarch64 | grep -w -v arm64 | grep -w -v armv7l | grep browser_download_url | grep -i appimage | cut -d '"' -f 4 | head -1) | ||
if [ $version = $version0 ]; then | ||
echo "Update not needed!" | ||
else | ||
notify-send "A new version of $APP is available, please wait" | ||
mkdir /opt/$APP/tmp | ||
cd /opt/$APP/tmp | ||
wget $version | ||
if ls . | grep mage; then | ||
SITE="mmtrt/foobar2000_AppImage" | ||
version0=$(cat "/opt/$APP/version") | ||
version=$(curl -Ls https://api.github.com/repos/mmtrt/foobar2000_AppImage/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386|i686|aarch64|arm64|armv7l" | head -1) | ||
[ -n "$version" ] || { echo "Error getting link"; exit 1; } | ||
if [ "$version" != "$version0" ] || [ -e /opt/"$APP"/*.zsync ]; then | ||
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1 | ||
[ -e ../*.zsync ] || notify-send "A new version of $APP is available, please wait" | ||
[ -e ../*.zsync ] && wget "$version.zsync" 2>/dev/null || { wget "$version" || exit 1; } | ||
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded. | ||
cd .. | ||
if test -f ./tmp/*mage; then rm ./version | ||
fi | ||
echo $version >> ./version | ||
mv --backup=t ./tmp/*mage ./$APP | ||
chmod a+x /opt/$APP/$APP | ||
rm -R -f ./tmp ./*~ | ||
fi | ||
notify-send "$APP is updated!" | ||
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null || mv --backup=t ./tmp/*mage ./"$APP" | ||
[ -e ./*.zsync ] && { zsync ./"$APP".zsync || notify-send -u critical "zsync failed to update $APP"; } | ||
chmod a+x ./"$APP" || exit 1 | ||
echo "$version" > ./version | ||
rm -R -f ./*zs-old ./*.part ./tmp ./*~ | ||
notify-send "$APP is updated!" | ||
else | ||
echo "Update not needed!" | ||
fi | ||
EOF | ||
chmod a+x /opt/$APP/AM-updater | ||
chmod a+x ./AM-updater || exit 1 | ||
|
||
# LAUNCHER & ICON | ||
app=$(echo $APP | cut -c -3) | ||
cd /opt/$APP | ||
./$APP --appimage-extract *.desktop 1>/dev/null | ||
./$APP --appimage-extract share/applications/*.desktop 1>/dev/null | ||
./$APP --appimage-extract usr/share/applications/*.desktop 1>/dev/null | ||
mv squashfs-root/*.desktop ./$APP.desktop | ||
mv squashfs-root/share/applications/*.desktop ./$APP.desktop | ||
mv squashfs-root/usr/share/applications/*.desktop ./$APP.desktop | ||
if [ ! -e ./$APP.desktop ]; then | ||
rm ./$APP.desktop; ./$APP --appimage-extract usr/share/applications/*$app*.desktop | ||
mv squashfs-root/usr/share/applications/*.desktop ./$APP.desktop | ||
fi | ||
if [ ! -e ./$APP.desktop ]; then | ||
rm ./$APP.desktop; ./$APP --appimage-extract share/applications/*$app*.desktop 1>/dev/null | ||
mv squashfs-root/share/applications/*.desktop ./$APP.desktop | ||
fi | ||
CHANGEEXEC=$(cat ./$APP.desktop | grep Exec= | tr ' ' '\n' | tr '=' '\n' | tr '/' '\n' | grep $app | head -1) | ||
sed -i "s#$CHANGEEXEC#$APP#g" ./$APP.desktop | ||
sed -i "s#AppRun#$APP#g" ./$APP.desktop | ||
sed -i "s#Exec=/bin/#Exec=#g" ./$APP.desktop | ||
sed -i "s#Exec=/usr/bin/#Exec=#g" ./$APP.desktop | ||
CHANGEICON=$(cat ./$APP.desktop | grep Icon= | head -1) | ||
sed -i "s#$CHANGEICON#Icon=/opt/$APP/icons/$APP#g" ./$APP.desktop | ||
|
||
mkdir icons | ||
./$APP --appimage-extract *.png 2>&1 | grep -v "squashfs-root"; mv ./squashfs-root/*$app* ./icons/$APP 2>/dev/null | ||
./$APP --appimage-extract *.svg 2>&1 | grep -v "squashfs-root"; mv ./squashfs-root/*$app* ./icons/$APP 2>/dev/null | ||
./$APP --appimage-extract share/icons/*/*/* 1>/dev/null | ||
./$APP --appimage-extract usr/share/icons/*/*/* 1>/dev/null | ||
./$APP --appimage-extract share/icons/*/*/*/* 1>/dev/null | ||
./$APP --appimage-extract usr/share/icons/*/*/*/* 1>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/22x22/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/24x24/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/32x32/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/48x48/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/64x64/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/128x128/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/256x256/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/512x512/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/share/icons/hicolor/scalable/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/22x22/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/24x24/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/32x32/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/48x48/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/64x64/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/128x128/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/256x256/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/512x512/apps/*$app* ./icons/$APP 2>/dev/null | ||
mv ./squashfs-root/usr/share/icons/hicolor/scalable/apps/*$app* ./icons/$APP 2>/dev/null | ||
|
||
rm -R -f /opt/$APP/squashfs-root | ||
mv ./$APP.desktop /usr/share/applications/AM-$APP.desktop | ||
|
||
|
||
|
||
|
||
./"$APP" --appimage-extract *.desktop 1>/dev/null && mv ./squashfs-root/*.desktop ./"$APP".desktop | ||
./"$APP" --appimage-extract .DirIcon 1>/dev/null && mv ./squashfs-root/.DirIcon ./DirIcon | ||
COUNT=0 | ||
while [ "$COUNT" -lt 10 ]; do # Tries to get the actual icon/desktop if it is a symlink to another symlink | ||
if [ -L ./"$APP".desktop ]; then | ||
LINKPATH="$(readlink ./"$APP".desktop | sed 's|^\./||' 2>/dev/null)" | ||
./"$APP" --appimage-extract "$LINKPATH" 1>/dev/null && mv ./squashfs-root/"$LINKPATH" ./"$APP".desktop | ||
fi | ||
if [ -L ./DirIcon ]; then | ||
LINKPATH="$(readlink ./DirIcon | sed 's|^\./||' 2>/dev/null)" | ||
./"$APP" --appimage-extract "$LINKPATH" 1>/dev/null && mv ./squashfs-root/"$LINKPATH" ./DirIcon | ||
fi | ||
[ ! -L ./"$APP".desktop ] && [ ! -L ./DirIcon ] && break | ||
COUNT=$((COUNT + 1)) | ||
done | ||
sed -i "s#Exec=[^ ]*#Exec=$APP#g; s#Icon=.*#Icon=/opt/$APP/icons/$APP#g" ./"$APP".desktop | ||
mv ./"$APP".desktop /usr/local/share/applications/"$APP"-AM.desktop && mv ./DirIcon ./icons/"$APP" 1>/dev/null | ||
rm -R -f ./squashfs-root |
Oops, something went wrong.