#!/bin/bash # Test script for page_progress and auto_progress features in presentations echo "==========================================" echo "Progress Bar Features Test" echo "==========================================" echo "" # Colors for output GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color # Check if MQTT broker is configured if [ -f ../.env ]; then source ../.env MQTT_HOST=${MQTT_BROKER:-localhost} else MQTT_HOST=localhost fi echo -e "${YELLOW}Using MQTT broker: ${MQTT_HOST}${NC}" echo "" # Menu for testing different progress bar configurations echo "Select a test configuration:" echo "" echo "1. No progress bars (default)" echo "2. Page progress only (overall position)" echo "3. Auto-progress only (per-page countdown)" echo "4. Both progress bars (maximum feedback)" echo "" read -p "Enter choice (1-4): " choice case $choice in 1) PAGE_PROG=false AUTO_PROG=false DESC="No progress bars" ;; 2) PAGE_PROG=true AUTO_PROG=false DESC="Page progress only (--page-progress)" ;; 3) PAGE_PROG=false AUTO_PROG=true DESC="Auto-progress only (--auto-progress)" ;; 4) PAGE_PROG=true AUTO_PROG=true DESC="Both progress bars" ;; *) echo "Invalid choice" exit 1 ;; esac echo "" echo -e "${BLUE}Configuration: $DESC${NC}" echo " page_progress: $PAGE_PROG" echo " auto_progress: $AUTO_PROG" echo "" # Create test event with progress bar settings TEST_EVENT=$(cat < ] 50%" echo "• Updates as slides change" ;; 3) echo "• Countdown bar for each slide" echo "• Shows time remaining until next slide" echo "• Resets on each slide transition" ;; 4) echo "• Overall progress bar at bottom" echo "• Per-slide countdown overlay" echo "• Both indicators update in real-time" ;; esac echo "" echo "==========================================" echo "Impressive Command Options" echo "==========================================" echo "" echo "The Display Manager translates event fields to Impressive options:" echo "" echo "Event Field → Impressive Option" echo "-------------------- → ------------------" echo "page_progress: true → --page-progress (or -q)" echo "auto_progress: true → --auto-progress (or -k)" echo "" echo "Check the impressive.out.log for the exact command used:" echo " tail -20 ../logs/impressive.out.log" echo "" echo -e "${GREEN}Test complete!${NC}" echo "" echo "Tips:" echo " • Press 'q' to quit the presentation" echo " • Run this script again to test different configurations" echo " • Check logs/display_manager.log for detailed output" echo ""