-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
50 lines (40 loc) · 1.46 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Setup script for Linpad
# Step 1: Install dependencies
echo "Installing required dependencies..."
sudo apt update
sudo apt install -y python3 python3-tk python3-pil python3-pil.imagetk
# Step 2: Create directories
echo "Setting up directories..."
sudo mkdir -p /usr/local/bin/linpad
sudo mkdir -p /usr/share/applications
sudo mkdir -p /usr/share/icons/hicolor/48x48/apps
# Step 3: Copy application files
echo "Copying application files..."
sudo cp linpad.py /usr/local/bin/linpad/linpad.py
sudo cp lin_logo.webp /usr/local/bin/linpad/lin_logo.webp
# Step 4: Create executable script
echo "Creating executable command..."
echo '#!/bin/bash' | sudo tee /usr/bin/linpad
echo 'python3 /usr/local/bin/linpad/linpad.py' | sudo tee -a /usr/bin/linpad
sudo chmod +x /usr/bin/linpad
# Step 5: Create .desktop entry
echo "Creating desktop entry..."
cat <<EOL | sudo tee /usr/share/applications/linpad.desktop
[Desktop Entry]
Version=1.0
Name=Linpad
Exec=linpad
Icon=/usr/local/bin/linpad/lin_logo.webp
Type=Application
Categories=TextEditor;Utility;
Terminal=false
EOL
# Step 6: Copy icon to appropriate directory
echo "Copying application icon..."
sudo cp lin_logo.webp /usr/share/icons/hicolor/48x48/apps/linpad.webp
# Step 7: Update system icon cache (optional)
echo "Updating icon cache..."
sudo gtk-update-icon-cache /usr/share/icons/hicolor
# Step 8: Final message
echo "Linpad has been installed! You can run it via the applications menu or by typing 'linpad' in the terminal."