hotel_pi/scripts/launch-kiosk.sh
2026-04-06 21:33:52 -04:00

59 lines
1.5 KiB
Bash

#!/bin/bash
# Launch Hotel Pi kiosk in Chromium fullscreen mode
# Run this script to start the kiosk application
set -e
# Configuration
KIOSK_URL="${KIOSK_URL:-http://localhost:5173}"
KIOSK_HOME="${KIOSK_HOME:-$HOME/.hotel_pi_kiosk}"
LOG_FILE="${LOG_FILE:-/tmp/hotel_pi_kiosk.log}"
# Create cache directory
mkdir -p "$KIOSK_HOME"
echo "🏨 Starting Hotel Pi Kiosk..." | tee -a "$LOG_FILE"
echo "URL: $KIOSK_URL" | tee -a "$LOG_FILE"
echo "Time: $(date)" | tee -a "$LOG_FILE"
# Kill any existing Chromium instances
pkill -f "chromium.*kiosk" || true
sleep 1
# Launch Chromium in kiosk mode
chromium-browser \
--kiosk \
--no-first-run \
--no-default-browser-check \
--disable-translate \
--disable-infobars \
--disable-suggestions-ui \
--disable-save-password-bubble \
--disable-session-crashed-bubble \
--disable-component-extensions-with-background-pages \
--disable-extensions \
--disable-default-apps \
--disable-preconnect \
--disable-background-networking \
--disable-breakpad \
--disable-client-side-phishing-detection \
--disable-component-update \
--disable-sync \
--disable-device-discovery-notifications \
--disable-hang-monitor \
--disable-popup-blocking \
--disable-prompt-on-repost \
--start-maximized \
--window-size=1920,1080 \
--user-data-dir="$KIOSK_HOME" \
--app="$KIOSK_URL" \
>> "$LOG_FILE" 2>&1 &
KIOSK_PID=$!
echo "✓ Kiosk started (PID: $KIOSK_PID)" | tee -a "$LOG_FILE"
# Wait for Chromium process
wait $KIOSK_PID || true
echo "❌ Kiosk stopped" | tee -a "$LOG_FILE"