#!/bin/bash # Installe la photostation sur la Surface pour intégration photobooth set -e DEST="/opt/photostation" REPO="https://git.copydev.fr/jules/photostation.git" echo "=== Installation Photostation ===" # Dépendances système sudo apt-get install -y \ python3-pyqt6 python3-pyqt6.qtsvg \ python3-pillow python3-flask \ python3-qrcode python3-cups \ libgl1 libglib2.0-0 2>&1 | grep -E 'Install|Upgrade|already' # Cloner ou mettre à jour if [ -d "$DEST/.git" ]; then echo "Mise à jour du repo..." git -C "$DEST" pull else echo "Clonage du repo..." sudo git clone "$REPO" "$DEST" sudo chown -R jules:jules "$DEST" fi # Venv avec accès aux paquets système (PyQt6 est en paquet système) if [ ! -d "$DEST/venv" ]; then python3 -m venv --system-site-packages "$DEST/venv" fi # Dépendances Python supplémentaires "$DEST/venv/bin/pip" install --quiet qrcode[pil] 2>/dev/null || true echo "" echo "=== Installation terminée ===" echo "Test : DISPLAY=:0 bash -c 'source $DEST/venv/bin/activate && python $DEST/src/main.py'"