diff --git a/image-recipe/configs/archipelago-kiosk-launcher.sh b/image-recipe/configs/archipelago-kiosk-launcher.sh index 90d77e43..2f34a33e 100644 --- a/image-recipe/configs/archipelago-kiosk-launcher.sh +++ b/image-recipe/configs/archipelago-kiosk-launcher.sh @@ -33,14 +33,18 @@ configure_display() { [ -n "$output" ] || output=$(awk '/ connected/{print $1; exit}' /tmp/archipelago-kiosk-xrandr.txt) [ -n "$output" ] || return 0 + # Pick the EDID-preferred ("+") mode, falling back to the first-listed + # mode (EDID lists native first). Deliberately ignore "*" (currently + # active) — trusting "active" lets a bad clone/mirror state from a + # previous boot perpetuate itself forever instead of self-healing. mode=$(awk -v out="$output" ' $1 == out { active = 1; next } active && /^[[:space:]]+[0-9]+x[0-9]+/ { - if ($0 ~ /\*/) { print $1; exit } + if ($0 ~ /\+/ && !preferred) { preferred = $1 } if (!first) first = $1 } active && /^[^[:space:]]/ { active = 0 } - END { if (first) print first } + END { if (preferred) print preferred; else if (first) print first } ' /tmp/archipelago-kiosk-xrandr.txt) [ -n "$mode" ] || mode=1920x1080