Use twm instead of fluxbox, as fluxbox insists on drawing a background, and any configuration attempt fails half of the time.

This commit is contained in:
Georges Dupéron 2018-07-07 18:09:58 +02:00
parent 5daa80a125
commit 184d52101e
2 changed files with 10 additions and 3 deletions

View File

@ -4,7 +4,7 @@ addons:
packages: &common_apt_packages
# graphical environment
- scrot
- fluxbox
- twm
# automated GUI testing
- sikuli-ide
# Missing dependencies for sikuli-ide

View File

@ -5,7 +5,8 @@ set -e
resolution="$1" # e.g. 800x600x24 (width x height x bits_per_pixel)
shift # the following arguments are the program to execute and its arguments
bg="$(mktemp --suffix='.png')"
bg="$(mktemp --suffix='.xbm')"
twm_cfg="$(mktemp --suffix='_twm.cfg')"
anim="$(mktemp -d)"
# Create solid black background
@ -14,7 +15,13 @@ convert -size "$(echo "$resolution" | cut -d 'x' -f1-2)" \
-auto-level +level-colors 'gray(192),gray(128)' \
"$bg"
xvfb-run -a --server-args="-screen 0 ${resolution}" sh -c 'fluxbox 2>/dev/null & sleep 5; fbsetbg -f "'"$bg"'"; sleep 5; utils/screenshots-loop.sh "'"$anim"'" & "$@"' utils/gui-wrapper.sh-subshell "$@"
cat > "$twm_cfg" <<EOF
RandomPlacement
EOF
# -fg chocolate -bg coral looks nice too :)
echo "$bg $twm_cfg $anim"
xvfb-run -a --server-args="-screen 0 ${resolution}" sh -c 'twm -f "'"$twm_cfg"'" & xsetroot -bitmap "'"$bg"'" -fg gray75 -bg gray50; sleep 1; utils/screenshots-loop.sh "'"$anim"'" & "$@"' utils/gui-wrapper.sh-subshell "$@"
touch "$anim/stop-screenshots"
for i in `seq 60`; do if test -e "$anim/anim-done"; then break; fi; sleep 1; done