-
-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathinstall-64
More file actions
executable file
·57 lines (44 loc) · 1.48 KB
/
Copy pathinstall-64
File metadata and controls
executable file
·57 lines (44 loc) · 1.48 KB
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
50
51
52
53
54
55
56
57
#!/bin/bash
# Stop on first error
set -e
# 1. Install dependencies from Pi-Apps and APT
# This is the line you added, now correctly placed at the beginning.
# It will ask Pi-Apps to install Scrcpy if it's not already installed.
"${DIRECTORY}/manage" install-if-not-installed Scrcpy || exit 1
# Install other necessary system packages
sudo apt-get install -y python3-pip git python3-venv
# 2. Clone the repository and build the app
APP_NAME="yascrcpy"
TEMP_DIR=$(mktemp -d)
# Clone the source code
git clone --depth 1 "https://github.com/gabreek/qt-yascrcpygui.git" "${TEMP_DIR}"
# Change into the temp directory
cd "${TEMP_DIR}"
# Create a virtual environment and install Python packages
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install pyinstaller
# Build the executable
pyinstaller main.spec
deactivate
# 3. Install the application files
# Copy the built program to a system-wide location
sudo cp "dist/${APP_NAME}" "/usr/local/bin/${APP_NAME}"
# Copy the icon
sudo cp "gui/icon.png" "/usr/share/pixmaps/${APP_NAME}.png"
# Create the Start Menu shortcut
sudo tee "/usr/share/applications/${APP_NAME}.desktop" >/dev/null <<EOF
[Desktop Entry]
Version=1.0
Name=yaScrcpy GUI
Comment=A Qt-based GUI for scrcpy and Winlator
Exec=${APP_NAME}
Icon=/usr/share/pixmaps/${APP_NAME}.png
Terminal=false
Type=Application
Categories=Utility;System;
EOF
# 4. Clean up temporary files
rm -rf "${TEMP_DIR}"
echo "Installation complete! Find 'yaScrcpy GUI' in your Start Menu."