run.sh 1.0 KB

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. # OpenController Steam Deck forwarder launcher (uv-based; nothing installed system-wide).
  3. #
  4. # Add as a NON-STEAM GAME:
  5. # Target: /home/deck/…/deck/run.sh
  6. # Start In: /home/deck/…/deck/ (the directory this script is in)
  7. # Then, in that shortcut's gear -> Properties -> Controller, set "Disable Steam Input" so Steam doesn't
  8. # fight us for the built-in pad while we grab it.
  9. #
  10. # Dependencies are pulled by uv on first run (pyserial + pygame -- both prebuilt wheels, no compiler).
  11. # uv also provisions its own Python, so nothing touches the read-only SteamOS rootfs.
  12. #
  13. # If you get a serial permission error on /dev/ttyACM*, run `sudo ./setup.sh` once per boot (see README).
  14. set -euo pipefail
  15. cd "$(dirname "$(readlink -f "$0")")"
  16. UV="$(command -v uv || true)"
  17. [ -n "$UV" ] || UV="$HOME/.local/bin/uv"
  18. [ -x "$UV" ] || { echo "uv not found. Install it: https://docs.astral.sh/uv/ (curl -LsSf https://astral.sh/uv/install.sh | sh)"; exit 1; }
  19. exec "$UV" run --with pyserial --with pygame python openctrl.py "$@"