Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #1032

Merged
merged 2 commits into from
Oct 26, 2024
Merged

sync #1032

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions programs/x86_64-apps
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@
◆ one-gpt : Aggregate ChatGPT official version, Wenxin Yiyan, Poe, chatchat.
◆ onekey-wallet : Open source crypto wallet.
◆ onenote : P3X Onenote Linux.
◆ onionmediax : OnionMedia X. Convert and download videos and music quickly and easily.
◆ onlyoffice : Office Suite with full support for MS Windows formats and cloud.
◆ onlyrefs : Organize all of your references, notes, bookmarks and more.
◆ onnx2bnn : Binary neural networks inference framework for mobile platform.
Expand Down
71 changes: 71 additions & 0 deletions programs/x86_64/onionmediax
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/sh

# AM INSTALL SCRIPT VERSION 3.5
set -u
APP=onionmediax
SITE="onionware-github/OnionMedia-X"

# 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

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(curl -Ls https://api.github.com/repos/onionware-github/OnionMedia-X/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | grep -i "onionmedia.*x64.*zip$" | 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 ./OnionMedia_X || exit 1

# LINK TO PATH
ln -s "/opt/$APP/OnionMedia_X" "/usr/local/bin/$APP"

# SCRIPT TO UPDATE THE PROGRAM
cat >> ./AM-updater << 'EOF'
#!/bin/sh
set -u
APP=onionmediax
SITE="onionware-github/OnionMedia-X"
version0=$(cat "/opt/$APP/version")
version=$(curl -Ls https://api.github.com/repos/onionware-github/OnionMedia-X/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | grep -i "onionmedia.*x64.*zip$" | 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 ./OnionMedia_X || exit 1
echo "$version" > ./version
rm -R -f ./tmp ./*~
notify-send "$APP is updated!"
else
echo "Update not needed!"
fi
EOF
chmod a+x ./AM-updater || exit 1

# ICON
mkdir -p icons
wget https://raw.githubusercontent.com/onionware-github/OnionMedia/main/images/icon.svg -O ./icons/"$APP" 2> /dev/null

# LAUNCHER
echo "[Desktop Entry]
Name=OnionMediaX
Comment=OnionMedia X - The Free Media Converter and Downloader. Converts and downloads videos and music quickly and easily.
Icon=/opt/$APP/icons/$APP
Exec=$APP
Terminal=false
NoDisplay=false
Type=Application
Categories=Utility;
StartupNotify=true" > /usr/local/share/applications/"$APP"-AM.desktop
8 changes: 4 additions & 4 deletions programs/x86_64/sonusmix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# AM INSTALL SCRIPT VERSION 3.5
set -u
APP=sonusmix
SITE="https://codeberg.org/sonusmix/sonusmix"
SITE="sonusmix/sonusmix"

# CREATE DIRECTORIES AND ADD REMOVER
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
Expand All @@ -12,7 +12,7 @@ printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove
chmod a+x ../remove || exit 1

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(curl -Ls https://codeberg.org/sonusmix/sonusmix/releases | grep -Po '(?<=href=")[^"]*' | grep -i "appimage$" | grep -v continuous | head -1)
version=$(curl -Ls https://codeberg.org/sonusmix/sonusmix/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | grep -v "continuous" | head -1)
wget "$version" || exit 1
# Keep this space in sync with other installation scripts
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
Expand All @@ -31,9 +31,9 @@ cat >> ./AM-updater << 'EOF'
#!/bin/sh
set -u
APP=sonusmix
SITE="https://codeberg.org/sonusmix/sonusmix"
SITE="sonusmix/sonusmix"
version0=$(cat "/opt/$APP/version")
version=$(curl -Ls https://codeberg.org/sonusmix/sonusmix/releases | grep -Po '(?<=href=")[^"]*' | grep -i "appimage$" | grep -v continuous | head -1)
version=$(curl -Ls https://codeberg.org/sonusmix/sonusmix/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | grep -v "continuous" | head -1)
[ -n "$version" ] || { echo "Error getting link"; exit 1; }
if command -v appimageupdatetool >/dev/null 2>&1; then
cd "/opt/$APP" || exit 1
Expand Down
25 changes: 14 additions & 11 deletions programs/x86_64/tenacity
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# AM INSTALL SCRIPT VERSION 3.5
set -u
APP=tenacity
SITE="https://tenacityaudio.org"
SITE="tenacityteam/tenacity"

# CREATE DIRECTORIES AND ADD REMOVER
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
Expand All @@ -12,13 +12,13 @@ printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove
chmod a+x ../remove || exit 1

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(curl -Ls https://codeberg.org/tenacityteam/tenacity/releases | grep -Po '(?<=href=")[^"]*' | grep -i "appimage$" | head -1)
version=$(curl -Ls https://codeberg.org/tenacityteam/tenacity/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
# Keep this space in sync with other installation scripts
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
mv ./tmp/*mage ./"$APP"
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null
# Keep this space in sync with other installation scripts
rm -R -f ./tmp || exit 1
echo "$version" > ./version
chmod a+x ./"$APP" || exit 1
Expand All @@ -31,18 +31,21 @@ cat >> ./AM-updater << 'EOF'
#!/bin/sh
set -u
APP=tenacity
SITE="https://tenacityaudio.org"
SITE="tenacityteam/tenacity"
version0=$(cat "/opt/$APP/version")
version=$(curl -Ls https://codeberg.org/tenacityteam/tenacity/releases | grep -Po '(?<=href=")[^"]*' | grep -i "appimage$" | head -1)
version=$(curl -Ls https://codeberg.org/tenacityteam/tenacity/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
if command -v appimageupdatetool >/dev/null 2>&1; then
cd "/opt/$APP" || exit 1
appimageupdatetool -Or ./"$APP" && chmod a+x ./"$APP" && echo "$version" > ./version && exit 0
fi
if [ "$version" != "$version0" ]; 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; }
notify-send "A new version of $APP is available, please wait"
wget "$version" || exit 1
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
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"; }
mv --backup=t ./tmp/*mage ./"$APP"
chmod a+x ./"$APP" || exit 1
echo "$version" > ./version
rm -R -f ./*zs-old ./*.part ./tmp ./*~
Expand Down