Files

52 lines
1.4 KiB
Bash

#!/bin/bash
# Script de lancement de la version PyQt6
# Gère les différentes configurations d'affichage et installe les dépendances
set -e
echo "🎵 dl_yt - PyQt6 GUI Launcher"
echo "================================"
# Activer le venv
if [ -d ".venv" ]; then
echo "✅ Activating venv..."
source .venv/bin/activate
else
echo "❌ Venv not found. Create it with:"
echo " python3 -m venv .venv"
echo " source .venv/bin/activate"
echo " pip install -r requirements.txt"
exit 1
fi
# Détecter l'environment d'affichage
echo "🔍 Detecting display..."
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
echo "⚠️ No X11 or Wayland display detected"
echo "💡 Using Xvfb (virtual display)..."
# Vérifier si xvfb-run existe
if ! command -v xvfb-run &> /dev/null; then
echo "📦 Installing Xvfb..."
sudo apt update > /dev/null
sudo apt install -y xvfb libxcb-cursor0 > /dev/null
echo "✅ Xvfb installed"
fi
# Vérifier libxcb-cursor0
if ! dpkg -l | grep -q libxcb-cursor0; then
echo "📦 Installing libxcb-cursor0..."
sudo apt install -y libxcb-cursor0 > /dev/null
echo "✅ libxcb-cursor0 installed"
fi
echo "🚀 Starting PyQt6 GUI (Xvfb)..."
xvfb-run python main.py "$@"
else
echo "✅ Display detected: $DISPLAY"
echo "🚀 Starting PyQt6 GUI..."
python main.py "$@"
fi