VT_Player/scripts/run.sh

40 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# VT Player Run Script
# Builds (if needed) and runs the application
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BUILD_OUTPUT="$PROJECT_ROOT/vt_player"
echo "════════════════════════════════════════════════════════════════"
echo " VT Player - Run Script"
echo "════════════════════════════════════════════════════════════════"
echo ""
# Check if binary exists
if [ ! -f "$BUILD_OUTPUT" ]; then
echo "⚠️ Binary not found. Building..."
echo ""
bash "$PROJECT_ROOT/scripts/build.sh"
echo ""
fi
# Verify binary exists
if [ ! -f "$BUILD_OUTPUT" ]; then
echo "❌ ERROR: Build failed, cannot run."
exit 1
fi
echo "🚀 Starting VT Player..."
echo "════════════════════════════════════════════════════════════════"
echo ""
# Optional software rendering fallback:
# Default to software (avoid GLX errors); set VTPLAYER_HW=1 to force hardware.
if [ "$VTPLAYER_HW" != "1" ]; then
export FYNE_SW_CANVAS=1
export LIBGL_ALWAYS_SOFTWARE=1
fi
# Run the application
"$BUILD_OUTPUT" "$@"