-
-
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
4 changed files
with
189 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/sh | ||
|
||
# AM INSTALL SCRIPT VERSION 3. | ||
set -u | ||
APP=lapce | ||
SITE="lapce/lapce" | ||
|
||
# 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" > "/opt/$APP/remove" | ||
printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove" | ||
chmod a+x "/opt/$APP/remove" | ||
|
||
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates | ||
version=$(curl -Ls https://api.github.com/repos/lapce/lapce/releases/latest | jq '.' | grep browser_download_url | grep -i linux-amd64.tar.gz | cut -d '"' -f 4 | head -1) | ||
wget "$version" || exit 1 | ||
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z | ||
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.* | ||
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv ./tmp/*/* ./; else mv ./tmp/* ./"$APP" 2>/dev/null || mv ./tmp/* ./; fi | ||
rm -R -f ./tmp || exit 1 | ||
echo "$version" > ./version | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
|
||
# LINK TO PATH | ||
ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP" | ||
|
||
# SCRIPT TO UPDATE THE PROGRAM | ||
cat >> "/opt/$APP/AM-updater" << 'EOF' | ||
#!/bin/sh | ||
set -u | ||
APP=lapce | ||
SITE="lapce/lapce" | ||
version0=$(cat "/opt/$APP/version") | ||
version=$(curl -Ls https://api.github.com/repos/lapce/lapce/releases/latest | jq '.' | grep browser_download_url | grep -i linux-amd64.tar.gz | cut -d '"' -f 4 | head -1) | ||
[ -n "$version" ] || { echo "Error getting link"; exit 1; } | ||
if [ "$version" != "$version0" ]; then | ||
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1 | ||
notify-send "A new version of $APP is available, please wait" | ||
wget "$version" || exit 1 | ||
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z | ||
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.* | ||
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv --backup=t ./tmp/*/* ./; else mv --backup=t ./tmp/* ./"$APP" 2>/dev/null || mv --backup=t ./tmp/* ./; fi | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
echo "$version" > ./version | ||
rm -R -f ./tmp ./*~ | ||
notify-send "$APP is updated!" | ||
else | ||
echo "Update not needed!" | ||
fi | ||
EOF | ||
chmod a+x "/opt/$APP/AM-updater" | ||
|
||
# ICON | ||
mkdir -p icons | ||
wget https://raw.githubusercontent.com/lapce/lapce/master/extra/images/logo.png -O ./icons/"$APP" 2> /dev/null | ||
|
||
# LAUNCHER | ||
rm -f /usr/share/applications/AM-"$APP".desktop | ||
echo "[Desktop Entry] | ||
Version=1.0 | ||
Type=Application | ||
Name=Lapce | ||
Comment=Lightning-fast and powerful code editor written in Rust | ||
Categories=Development;IDE; | ||
GenericName=Code Editor | ||
StartupWMClass=lapce | ||
Icon=dev.lapce.lapce | ||
Exec=lapce %F | ||
Terminal=false | ||
MimeType=text/plain;inode/directory; | ||
Actions=new-window; | ||
[Desktop Action new-window] | ||
Name=New Window | ||
Exec=lapce --new %F | ||
Icon=/opt/$APP/icons/$APP" >> /usr/share/applications/AM-"$APP".desktop |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
# AM INSTALL SCRIPT VERSION 3. | ||
set -u | ||
APP=nerdfetch | ||
SITE="ThatOneCalculator/NerdFetch" | ||
|
||
# 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" > "/opt/$APP/remove" | ||
#printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove" | ||
chmod a+x "/opt/$APP/remove" | ||
|
||
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates | ||
version=$(curl -Ls https://api.github.com/repos/ThatOneCalculator/NerdFetch/releases/latest | jq '.' | grep tag | cut -d '"' -f 4 | head -1) | ||
wget https://raw.githubusercontent.com/ThatOneCalculator/NerdFetch/main/nerdfetch || exit 1 | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv ./tmp/*/* ./; else mv ./tmp/* ./"$APP" 2>/dev/null || mv ./tmp/* ./; fi | ||
rm -R -f ./tmp || exit 1 | ||
echo "$version" > ./version | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
|
||
# LINK TO PATH | ||
ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP" | ||
|
||
# SCRIPT TO UPDATE THE PROGRAM | ||
cat >> "/opt/$APP/AM-updater" << 'EOF' | ||
#!/bin/sh | ||
set -u | ||
APP=nerdfetch | ||
SITE="ThatOneCalculator/NerdFetch" | ||
version0=$(cat "/opt/$APP/version") | ||
version=$(curl -Ls https://api.github.com/repos/ThatOneCalculator/NerdFetch/releases/latest | jq '.' | grep tag | cut -d '"' -f 4 | head -1) | ||
[ -n "$version" ] || { echo "Error getting link"; exit 1; } | ||
if [ "$version" != "$version0" ]; then | ||
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1 | ||
notify-send "A new version of $APP is available, please wait" | ||
wget https://raw.githubusercontent.com/ThatOneCalculator/NerdFetch/main/nerdfetch || exit 1 | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv --backup=t ./tmp/*/* ./; else mv --backup=t ./tmp/* ./"$APP" 2>/dev/null || mv --backup=t ./tmp/* ./; fi | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
echo "$version" > ./version | ||
rm -R -f ./tmp ./*~ | ||
notify-send "$APP is updated!" | ||
else | ||
echo "Update not needed!" | ||
fi | ||
EOF | ||
chmod a+x "/opt/$APP/AM-updater" |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/sh | ||
|
||
# AM INSTALL SCRIPT VERSION 3. | ||
set -u | ||
APP=spotify-player | ||
SITE="aome510/spotify-player" | ||
|
||
# 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" > "/opt/$APP/remove" | ||
#printf '\n%s' "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove" | ||
chmod a+x "/opt/$APP/remove" | ||
|
||
# DOWNLOAD AND PREPARE THE APP, $version is also used for updates | ||
version=$(curl -Ls https://api.github.com/repos/aome510/spotify-player/releases | jq '.' | grep browser_download_url | grep -i x86_64-unknown-linux-gnu.tar.gz | cut -d '"' -f 4 | head -1) | ||
wget "$version" || exit 1 | ||
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z | ||
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.* | ||
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv ./tmp/*/* ./; else mv ./tmp/* ./"$APP" 2>/dev/null || mv ./tmp/* ./; fi | ||
rm -R -f ./tmp || exit 1 | ||
echo "$version" > ./version | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
|
||
# LINK TO PATH | ||
ln -s "/opt/$APP/$APP" "/usr/local/bin/$APP" | ||
|
||
# SCRIPT TO UPDATE THE PROGRAM | ||
cat >> "/opt/$APP/AM-updater" << 'EOF' | ||
#!/bin/sh | ||
set -u | ||
APP=spotify-player | ||
SITE="aome510/spotify-player" | ||
version0=$(cat "/opt/$APP/version") | ||
version=$(curl -Ls https://api.github.com/repos/aome510/spotify-player/releases | jq '.' | grep browser_download_url | grep -i x86_64-unknown-linux-gnu.tar.gz | cut -d '"' -f 4 | head -1) | ||
[ -n "$version" ] || { echo "Error getting link"; exit 1; } | ||
if [ "$version" != "$version0" ]; then | ||
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1 | ||
notify-send "A new version of $APP is available, please wait" | ||
wget "$version" || exit 1 | ||
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z | ||
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.* | ||
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip | ||
cd .. | ||
if [ -d ./tmp/* 2>/dev/null ]; then mv --backup=t ./tmp/*/* ./; else mv --backup=t ./tmp/* ./"$APP" 2>/dev/null || mv --backup=t ./tmp/* ./; fi | ||
chmod a+x "/opt/$APP/$APP" || exit 1 | ||
echo "$version" > ./version | ||
rm -R -f ./tmp ./*~ | ||
notify-send "$APP is updated!" | ||
else | ||
echo "Update not needed!" | ||
fi | ||
EOF | ||
chmod a+x "/opt/$APP/AM-updater" |