forked from Leak_Technologies/VideoTools
- Fix render.go CGO type assignments using plain uint32 casts - Add video playlist tracking with unique IDs - Improve drag-and-drop: assign to first available pane - Add parseURIs with crash protection for drag data - Improve mpv initialization handling - Update .gitignore for build artifacts (.cache, gtkplayer binary) - Improve GDK_BACKEND handling in run script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
53 lines
2.0 KiB
Bash
Executable File
53 lines
2.0 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"
|
||
GTK_ENTRY="$PROJECT_ROOT/cmd/gtkplayer"
|
||
|
||
echo "════════════════════════════════════════════════════════════════"
|
||
echo " VT Player - Run Script"
|
||
echo "════════════════════════════════════════════════════════════════"
|
||
echo ""
|
||
|
||
# If a GTK entry exists, run it directly (uses mpv embedded)
|
||
if [ -d "$GTK_ENTRY" ]; then
|
||
echo "🚀 Starting VT Player (GTK/mpv)..."
|
||
echo "════════════════════════════════════════════════════════════════"
|
||
echo ""
|
||
# Prefer an explicit backend only if the user hasn’t set one; default to X11 (works under XWayland).
|
||
if [ -z "$GDK_BACKEND" ]; then
|
||
export GDK_BACKEND=x11
|
||
fi
|
||
export GOCACHE="$PROJECT_ROOT/.cache/go-build"
|
||
export GOMODCACHE="$PROJECT_ROOT/.cache/go-mod"
|
||
GOCACHE="$GOCACHE" GOMODCACHE="$GOMODCACHE" \
|
||
go run "$GTK_ENTRY"
|
||
exit $?
|
||
fi
|
||
|
||
# Fallback to legacy binary
|
||
if [ ! -f "$BUILD_OUTPUT" ]; then
|
||
echo "⚠️ Binary not found. Building..."
|
||
echo ""
|
||
bash "$PROJECT_ROOT/scripts/build.sh"
|
||
echo ""
|
||
fi
|
||
|
||
if [ ! -f "$BUILD_OUTPUT" ]; then
|
||
echo "❌ ERROR: Build failed, cannot run."
|
||
exit 1
|
||
fi
|
||
|
||
echo "🚀 Starting VT Player..."
|
||
echo "════════════════════════════════════════════════════════════════"
|
||
echo ""
|
||
|
||
if [ "$VTPLAYER_HW" != "1" ]; then
|
||
export FYNE_SW_CANVAS=1
|
||
export LIBGL_ALWAYS_SOFTWARE=1
|
||
fi
|
||
|
||
"$BUILD_OUTPUT" "$@"
|