#!/bin/bash # Kivy Signage Player Startup Script # This script activates the virtual environment and starts the player # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "==========================================" echo "Starting Kivy Signage Player" echo "==========================================" echo "" # Change to the project directory cd "$SCRIPT_DIR" echo "Project directory: $SCRIPT_DIR" # Check if virtual environment exists if [ -d ".venv" ]; then echo "Activating virtual environment..." source .venv/bin/activate echo "✓ Virtual environment activated" else echo "Warning: Virtual environment not found at .venv/" echo "Creating virtual environment..." python3 -m venv .venv source .venv/bin/activate echo "Installing dependencies..." pip3 install -r requirements.txt echo "✓ Virtual environment created and dependencies installed" fi echo "" # Check if configuration exists if [ ! -f "config/app_config.json" ]; then echo "==========================================" echo "⚠ WARNING: Configuration file not found!" echo "==========================================" echo "" echo "Please configure the player before running:" echo " 1. Copy config/app_config.json.example to config/app_config.json" echo " 2. Edit the configuration file with your server details" echo "" read -p "Press Enter to continue anyway, or Ctrl+C to exit..." echo "" fi # Change to src directory and start the application echo "Starting application..." echo "==========================================" echo "" cd src python3 main.py # Deactivate virtual environment when app exits deactivate