Skip to content

Instantly share code, notes, and snippets.

@daquexian
Last active January 14, 2022 13:47
Show Gist options
  • Save daquexian/cd140d70b1772daa4a736c0642a68e9d to your computer and use it in GitHub Desktop.
Save daquexian/cd140d70b1772daa4a736c0642a68e9d to your computer and use it in GitHub Desktop.
generate appimage out-of-the-box
#!/usr/bin/env bash
set -uexo pipefail
if [ ! -f linuxdeploy-x86_64.AppImage ]
then
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
fi
if [ ! -f linuxdeploy-plugin-appimage-x86_64.AppImage ]
then
wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
fi
chmod +x linuxdeploy-*.AppImage
rm -rf appimage/appdir
mkdir -p appimage/appdir/usr/bin
cp $1 appimage/appdir/usr/bin/
bn=`basename $1`
echo "[Desktop Entry]
Name=$bn
Exec=$bn
Icon=$bn
Type=Application
Terminal=true
Categories=Development;" > appimage/$bn.desktop
convert -size 32x32 xc:white appimage/$bn.png
./linuxdeploy-x86_64.AppImage --appdir appimage/appdir -d appimage/$bn.desktop -i appimage/$bn.png --output appimage
rm -rf appimage/appdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment