Skip to content

Commit 6480c25

Browse files
authored
Create linux-app-installer.sh
1 parent 70b2b2b commit 6480c25

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

linux-app-installer.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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

Comments
 (0)