Skip to content

Instantly share code, notes, and snippets.

@yxqsnz
Created January 7, 2023 00:34
Show Gist options
  • Save yxqsnz/77be1bf95f4e963df86b27aa00ea3774 to your computer and use it in GitHub Desktop.
Save yxqsnz/77be1bf95f4e963df86b27aa00ea3774 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
[ -z "$1" ] && (echo "$0: tell me a file." && exit 1)
base=${HOME}/.local/share/appimage
appimage=$(realpath $1)
hash=($(md5sum $appimage))
appimage_root="$base/$hash"
[ -d $appimage_root ] || mkdir -p $appimage_root
[ -f $appimage_root/.ok ] || {
pushd $appimage_root
cp $appimage ./ai
chmod +x ./ai
./ai --appimage-extract
rm -f ai
touch .ok
popd
}
exec $appimage_root/squashfs-root/AppRun "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment