#!/usr/bin/env bash set -euo pipefail APP_BIN="${FC_DIVOOM_TV_BIN:-/opt/flowercore/divoom-tv/FlowerCore.Divoom.Tv}" STATE_DIR="${FC_DIVOOM_TV_STATE_DIR:-/var/lib/fc-divoom-tv}" LOG_DIR="${FC_DIVOOM_TV_LOG_DIR:-/var/log/fc-divoom-tv}" mkdir -p "${STATE_DIR}" "${LOG_DIR}" if [[ ! -x "${APP_BIN}" ]]; then echo "[$(date -Is)] missing executable ${APP_BIN}" >&2 exit 1 fi if [[ -d /sys/class/drm ]] && ! find /sys/class/drm -maxdepth 1 -name 'card*-HDMI-A-*' -print -quit | grep -q .; then echo "[$(date -Is)] no HDMI connector visible yet; continuing so the app can wait for display" >&2 fi if command -v cage >/dev/null 2>&1; then echo "[$(date -Is)] cage available for fullscreen Wayland launch" else echo "[$(date -Is)] cage not installed; direct launch fallback will be used" >&2 fi