#/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