Last active
May 20, 2018 12:58
-
-
Save Gumichan01/b40f78401c412fc976027004c48f8688 to your computer and use it in GitHub Desktop.
Simple script for automatically creating an 'AppDir' in order to create an AppImage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Simple script for automatically creating an 'AppDir' | |
# | |
# https://github.com/AppImage/AppImageKit/wiki/AppDir | |
# https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages | |
# | |
SCRIPT=`basename $0` | |
function usage { | |
echo "usage: "$SCRIPT" APP_NAME" | |
exit -1 | |
} | |
if [ $# -ne 1 ] | |
then | |
usage | |
fi | |
MyApp=$1 | |
myapp=`echo -n $1 | tr [:upper:] [:lower:]` | |
APP_DIR=$MyApp.AppDir | |
DESKTOP=$APP_DIR/$myapp.desktop | |
rm -rf $APP_DIR/ | |
mkdir -p $APP_DIR/usr/bin/ && \ | |
echo "WARNING: no executable file provided in '"$MyApp".AppDir/usr/bin/'" | |
mkdir -p $APP_DIR/usr/lib/ | |
touch $APP_DIR/AppRun && chmod a+x $APP_DIR/AppRun && \ | |
echo "WARNING: empty AppRun file. You must provide it properly" | |
touch $APP_DIR/$myapp.png && \ | |
echo -e "WARNING: empty/invalid '"$myapp".png'. You must specifiy an image file" | |
echo -e "INFO: You can provide PNG/JPEG/ICO file, but a PNG file is recommended\n" | |
echo "[Desktop Entry]" >> $DESKTOP | |
echo "Name="$MyApp >> $DESKTOP | |
echo "Exec="$MyApp >> $DESKTOP | |
echo "Icon=$myapp" >> $DESKTOP | |
echo "Type=Application" >> $DESKTOP | |
echo "Categories=Utility;" >> $DESKTOP | |
echo "Comment=" >> $DESKTOP | |
echo "Terminal=[true|false]" >> $DESKTOP | |
# If you have installed tree, you can use it | |
# tree $APP_DIR/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment