-
-
Notifications
You must be signed in to change notification settings - Fork 239
Add yaScrcpy GUI #2810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add yaScrcpy GUI #2810
Conversation
|
Pretty sure this won't work on arm32 due to no whl for pyside6 on it. https://pypi.org/project/PySide6/ |
|
Okay, I hadn't checked that. I've renamed the install script. |
| "${DIRECTORY}/manage" install-if-not-installed Scrcpy || exit 1 | ||
|
|
||
| # Install other necessary system packages | ||
| sudo apt-get install -y python3-pip git python3-venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be replaced with install_packages.
Please read https://pi-apps.io/wiki/development/Creating-an-app/
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All lines like these could fail for one reason or another, so if they fail, they need to make the script exit with an error message. Search all existing app install scripts for || error at the end of lines.
| main() { | ||
| status "Starting uninstallation of ${APP_NAME}..." | ||
|
|
||
| status "Removing application binary..." | ||
| sudo rm -f "${BIN_PATH}" | ||
|
|
||
| status "Removing application icon..." | ||
| sudo rm -f "${ICON_PATH}" | ||
|
|
||
| status "Removing application shortcut..." | ||
| sudo rm -f "${DESKTOP_FILE}" | ||
|
|
||
| status "Updating icon cache..." | ||
| # Use || true to prevent the script from failing on non-critical cache update errors | ||
| sudo update-icon-caches /usr/share/icons/* || true | ||
| sudo xdg-icon-resource forceupdate --mode system || true | ||
|
|
||
| # The dependencies (git, python3-pip, python3-venv) are common system packages | ||
| # and will not be removed to avoid breaking other applications. | ||
|
|
||
| status "Uninstallation of ${APP_NAME} completed successfully!" | ||
| } | ||
|
|
||
| # Run the main function | ||
| main "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of putting this into a main() function here??
| sudo rm -f "${DESKTOP_FILE}" | ||
|
|
||
| status "Updating icon cache..." | ||
| # Use || true to prevent the script from failing on non-critical cache update errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| true is only necessary if the script has set -e enabled, causing the script to exit if any comnmands exit with a nonzero exit code. Pi-Apps does not use set -e, meaning it does not care about nonzero exit codes, making || true unnecessary where failing is OK, but || error very important where failing is not OK.
What is the name of the app?
yaScrcpy GUI
Where is the app hosted?
https://github.com/gabreek/qt-yascrcpygui
About the app
Main Purpose
yaScrcpy GUI is a user-friendly graphical interface for the powerful Android screen
mirroring tool, scrcpy. It allows users to manage and launch scrcpy sessions without
needing to use the command line, making it more accessible for all users, especially those
who prefer a visual workflow.
How it Works
The application is built with Python and the PySide6 (Qt) framework. The provided
installation script handles the entire setup process:
It first checks if the scrcpy dependency is already installed on the system.
It then clones the source code from GitHub.
It builds a standalone executable using PyInstaller within an isolated Python virtual
environment to avoid conflicts with system packages.
Finally, it installs the binary, an application icon, and a .desktop shortcut for the
system's application menu.
Pi-Apps Eligibility
This app fits the Pi-Apps rubric because it is open-source, provides a useful function for
Raspberry Pi users (interacting with Android devices), and enhances an existing, popular
command-line utility (scrcpy) with an accessible GUI. It has no special kernel or hardware
requirements.
#2807