diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..001f613e139f55b37ea987dd00e50f43d6742b1f --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Entrypoint for the xle Docker image. +# +# - /grammar.lfg contains the grammar +# - $1 contains the sentence to be parsed (passed as parameter) + +# Write xlerc containing instructions to parse +echo "create-parser /grammar.lfg" > xlerc +echo "parse { $1 }" >> xlerc + +# Start X server in background, wait to ensure it has started properly +Xvfb :123 & +sleep 1 + +# Configure apps to use this X server +export DISPLAY=:123 + +# Start XLE, this will automatically load xlerc, wait until it has started and the parse is completed +xle & +sleep 3 + +# Take a screenshot of the entire screen and store it +import -window root /output/screenshot.png