-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Gabreek |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| This is a user-friendly graphical interface (GUI) to manage Scrcpy and Winlator. | ||
| Version: 0.15-alpha | ||
|
|
||
| What is Scrcpy? | ||
| Scrcpy is a powerful tool that lets you display and control your Android device's screen on your computer. It's like mirroring your phone screen, but you can also interact with it using your mouse and keyboard. | ||
|
|
||
| What is Winlator? | ||
| Winlator is an application for Android that allows you to run Windows programs and games. | ||
|
|
||
| How does this app help? | ||
| This GUI makes using Scrcpy and Winlator much easier. Instead of typing commands in a terminal, you get a simple, organized interface to manage your apps and games. | ||
|
|
||
| To run the app, open it from the Start Menu (look for "yaScrcpy GUI") or type `yascrcpy` in your terminal. | ||
|
|
||
| --- | ||
|
|
||
| ### Advanced Features | ||
|
|
||
| **Android App Launcher:** | ||
| - Automatically lists all installed applications on your device. | ||
| - Scrapes app icons from the Google Play Store. | ||
| - Supports custom icons via drag-and-drop. | ||
| - Save specific scrcpy settings for each app. | ||
|
|
||
| **Winlator Game Launcher:** | ||
| - Automatically discovers game shortcuts (.desktop files) from your Winlator installation. (You need to export shortcuts to the frontend in the Winlator app). | ||
| - Fetches and caches game icons directly from the game's .exe file. | ||
| - Supports custom game icons via drag-and-drop. | ||
| - Save specific scrcpy settings for each game, perfect for custom resolutions and performance tuning. | ||
|
|
||
| **Advanced Scrcpy Configuration:** | ||
| - A dedicated tab to tweak all major scrcpy settings, including resolution, bitrate, codecs, and more. All settings are saved automatically. | ||
| - The scrcpy window will automatically use the game's or app's icon, providing a native look and feel. | ||
|
|
||
| **Using `extraargs` for Advanced Scrcpy Commands:** | ||
| The `extraargs` field allows for highly customized scrcpy command execution, including running commands before (`PRE::`) and after (`POST::`) the scrcpy session. | ||
|
|
||
| - **Format:** Combine multiple commands by separating them with a semicolon `;`. | ||
| - `PRE::[command]`: Executes a command before scrcpy starts. | ||
| - `POST::[command]`: Executes a command after scrcpy exits. | ||
| - `[scrcpy_argument]`: Any other text is passed directly as an argument to scrcpy. | ||
|
|
||
| - **Examples:** | ||
| - `PRE::adb reverse tcp:8080 tcp:8080; --turn-screen-off` | ||
| - `--max-size 1024; POST::adb reverse --remove-all` | ||
| - `PRE::echo "Starting scrcpy"; --record file.mp4; POST::echo "Scrcpy finished"` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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" | ||
|
Comment on lines
+19
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| # 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." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit immediately if a command exits with a non-zero status. | ||
| set -euo pipefail | ||
|
|
||
| # --- Configuration (must match the install script) --- | ||
| readonly APP_NAME="yascrcpy" | ||
| readonly BIN_PATH="/usr/local/bin/${APP_NAME}" | ||
| readonly ICON_PATH="/usr/share/pixmaps/${APP_NAME}.png" | ||
| readonly DESKTOP_FILE="/usr/share/applications/${APP_NAME}.desktop" | ||
|
|
||
| # --- Helper Functions (from Pi-Apps) --- | ||
| # status() { ... } | ||
|
|
||
| # --- Main Execution --- | ||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| 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 "$@" | ||
|
Comment on lines
+16
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of putting this into a main() function here?? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| https://github.com/gabreek/qt-yascrcpygui |
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/