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

Forgor the icons dir again 💀 #605

Merged
merged 3 commits into from
May 26, 2024
Merged
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
3 changes: 1 addition & 2 deletions programs/x86_64/mpv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SITE1="Samueru-sama/mpv-AppImage"
SITE2="ivan-hc/MPV-appimage"

# CREATE DIRECTORIES AND ADD REMOVER
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
echo "#!/bin/sh\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
chmod a+x "/opt/$APP/remove"
Expand Down Expand Up @@ -80,7 +80,6 @@ chmod a+x "/opt/$APP/AM-updater"

# LAUNCHER & ICON
cd "/opt/$APP" || exit 1
mkdir /opt/"$APP"/icons
./"$APP" --appimage-extract .DirIcon 1>/dev/null && mv ./squashfs-root/.DirIcon ./DirIcon
./"$APP" --appimage-extract *.desktop 1>/dev/null && mv ./squashfs-root/*.desktop ./"$APP".desktop
./"$APP" --appimage-extract share/applications/*.desktop 1>/dev/null && mv ./squashfs-root/share/applications/*.desktop ./"$APP".desktop
Expand Down
18 changes: 16 additions & 2 deletions programs/x86_64/pavucontrol-qt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ APP=pavucontrol-qt
SITE="Samueru-sama/pavucontrol-qt-AppImage"

# CREATE DIRECTORIES AND ADD REMOVER
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
[ -n "$APP" ] && mkdir -p "/opt/$APP/tmp" "/opt/$APP/icons" && cd "/opt/$APP/tmp" || exit 1
echo "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > "/opt/$APP/remove"
echo "rm -f /usr/share/applications/AM-$APP.desktop" >> "/opt/$APP/remove"
echo "rm -f /usr/local/bin/pavucontrol" >> "/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/"$SITE"/releases | jq '.' | sed 's/[()",{}]/ /g; s/ /\n/g' | grep -oi 'https.*continuous.*Pulse.*86_64.*mage$' | head -1)
wget "$version" && echo "$version" > "/opt/$APP/version" || exit 1
cd ..
Expand Down Expand Up @@ -50,3 +50,17 @@ fi
echo "Update not needed!"
EOF
chmod a+x "/opt/$APP/AM-updater"

# LAUNCHER & ICON
cd "/opt/$APP" || exit 1
./"$APP" --appimage-extract .DirIcon 1>/dev/null && mv ./squashfs-root/.DirIcon ./DirIcon
./"$APP" --appimage-extract *.desktop 1>/dev/null && mv ./squashfs-root/*.desktop ./"$APP".desktop
./"$APP" --appimage-extract share/applications/*.desktop 1>/dev/null && mv ./squashfs-root/share/applications/*.desktop ./"$APP".desktop
./"$APP" --appimage-extract usr/share/applications/*.desktop 1>/dev/null && mv ./squashfs-root/usr/share/applications/*.desktop ./"$APP".desktop
if [ -L ./DirIcon ]; then
LINKPATH=$(readlink ./DirIcon)
./"$APP" --appimage-extract "$LINKPATH" && mv ./squashfs-root/"$LINKPATH" ./DirIcon
fi
sed -i "s#Exec=[^ ]*#Exec=$APP#g; s#Icon=.*#Icon=/opt/$APP/icons/$APP#g" ./"$APP".desktop
mv ./"$APP".desktop /usr/share/applications/AM-"$APP".desktop && mv ./DirIcon ./icons/"$APP" 2>/dev/null
rm -R -f ./squashfs-root