Skip to content

Instantly share code, notes, and snippets.

@saaj
Last active October 26, 2022 19:13
Show Gist options
  • Save saaj/a87f05faacd34c8ad2c7e3dd000bf551 to your computer and use it in GitHub Desktop.
Save saaj/a87f05faacd34c8ad2c7e3dd000bf551 to your computer and use it in GitHub Desktop.
Convert Redis Desktop Manger's Snap into an AppImage
#/bin/bash -e
# This coverts Redis Desktop Manager's Snap into an AppImage.
# Inspired by https://github.com/AppImage/AppImageKit/issues/166
# Tested on Linux Mint 18 / Ubuntu Xenial
if ! [ -x "$(command -v unsquashfs)" ]; then
echo 'Error: squashfs-tools is not installed.' >&2
exit 1
fi
# This is 2019.5-c57dd5f. Chech for newer or other arch with:
# curl -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/redis-desktop-manager
URL=https://api.snapcraft.io/api/v1/snaps/download/Iw3a6EauULwaud5DO0ixtrJg8o6VXaey_335.snap
wget -O rdm.snap $URL
unsquashfs -d appdir rdm.snap
cp appdir/usr/share/applications/rdm.desktop appdir/rdm.desktop
sed -i 's|Icon=${SNAP}/usr/share/pixmaps/rdm.png|Icon=/usr/share/pixmaps/rdm|' appdir/rdm.desktop
cp appdir/command-rdm.wrapper appdir/AppRun
sed -i '/#!\/bin\/sh/r'<(
echo 'export SNAP="$APPDIR"'
echo 'export SNAP_ARCH="amd64"'
echo 'export SNAP_USER_COMMON="$HOME/.config/rdm"'
) appdir/AppRun
sed -i 's/exec "desktop-launch"/exec/' appdir/AppRun
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage appdir
rm -rf appdir rdm.snap appimagetool-x86_64.AppImage
@saaj
Copy link
Author

saaj commented Nov 7, 2021

No longer needed because RDM is now on Flathub: https://flathub.org/apps/details/dev.rdm.RDM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment