|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# ------------------------------- |
| 4 | +# Change these variables to match your app: |
| 5 | +# ------------------------------- |
| 6 | + |
| 7 | +APP_NAME="MyApp" # The name of your application |
| 8 | +INSTALL_DIR="$HOME/$APP_NAME" # Where your app will be installed (in user home folder) |
| 9 | +EXECUTABLE="MyApp.sh" # The name of your launch script or executable inside the folder |
| 10 | +ICON="icon.png" # The icon file name inside your app folder |
| 11 | +WMCLASS="MyAppWindowClass" # The WM_CLASS string of your app window for taskbar grouping |
| 12 | + |
| 13 | +# ------------------------------- |
| 14 | +# Do not change below unless you know what you're doing |
| 15 | +# ------------------------------- |
| 16 | + |
| 17 | +# Create the install directory if it doesn't exist |
| 18 | +mkdir -p "$INSTALL_DIR" |
| 19 | + |
| 20 | +# Copy all files from current directory to install directory |
| 21 | +cp -r ./* "$INSTALL_DIR/" |
| 22 | + |
| 23 | +# Create a .desktop file for your app in the user's applications directory |
| 24 | +cat > ~/.local/share/applications/$APP_NAME.desktop <<EOF |
| 25 | +[Desktop Entry] |
| 26 | +Name=$APP_NAME # The app name shown in menus |
| 27 | +Comment=A great application # A short description of your app |
| 28 | +Exec=$INSTALL_DIR/$EXECUTABLE # Full path to the launch script or executable |
| 29 | +Icon=$INSTALL_DIR/$ICON # Full path to the icon file |
| 30 | +Terminal=false # Set to true if your app needs terminal |
| 31 | +Type=Application |
| 32 | +Categories=Utility; # Change categories if needed (e.g. Game; Development;) |
| 33 | +StartupWMClass=$WMCLASS # Helps group app windows in taskbar; see xprop for your app's WM_CLASS |
| 34 | +EOF |
| 35 | + |
| 36 | +# Make the executable script or binary runnable |
| 37 | +chmod +x "$INSTALL_DIR/$EXECUTABLE" |
0 commit comments