#!/usr/bin/env bash # Launch BikeControl. Always builds first via `cargo tauri build`, because a # plain `cargo build` produces a binary wired to localhost:1420 that shows a # BLACK WINDOW unless a Vite dev server happens to be running. Incremental # builds take seconds, and this removes a whole class of confusion. set -e ROOT="$(cd "$(dirname "$0")" && pwd)" LOG="$ROOT/bikecontrol.log" # WebKitGTK 2.52 on Wayland + Intel paints black rectangles via its DMABUF # renderer; disabling it costs nothing here (the UI is 2D canvas and CSS). export WEBKIT_DISABLE_DMABUF_RENDERER=1 export WEBKIT_DISABLE_COMPOSITING_MODE=1 export RUST_LOG="${RUST_LOG:-debug,btleplug=info,tao=warn,wry=warn}" echo "building (embeds the frontend — this is what avoids the black window)..." ( cd "$ROOT/src-tauri" && cargo tauri build --debug --no-bundle ) 2>&1 | tail -3 BIN="$ROOT/target/debug/bikecontrol-app" echo "=== BikeControl $(date '+%H:%M:%S') ===" > "$LOG" echo "launching $BIN — logging to $LOG" exec "$BIN" "$@" 2>&1 | tee -a "$LOG"