Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/yaScrcpy GUI/credits
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gabreek
46 changes: 46 additions & 0 deletions apps/yaScrcpy GUI/description
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"`
Binary file added apps/yaScrcpy GUI/icon-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/yaScrcpy GUI/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions apps/yaScrcpy GUI/install-64
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
Copy link
Owner

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/


# 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
Copy link
Owner

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.


# 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."
40 changes: 40 additions & 0 deletions apps/yaScrcpy GUI/uninstall
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
Copy link
Owner

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.

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
Copy link
Owner

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??

1 change: 1 addition & 0 deletions apps/yaScrcpy GUI/website
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/gabreek/qt-yascrcpygui