#!/bin/bash

Xvfb :3 &
xpid=$!
export DISPLAY=:3
export GIER_NOGPIO=1
date

cp configs/drumtjek.gier default.gier

cat >pi2.demo <<EOF
SHOW KB1
SHOW KB2
LOADREADER tapes/mk/pi2.asc
LOADPUNCH 00.flx
WAITINPUT
$(./maketext.sh 'r<')
WAITSTOP
PRESS START
HIDE KB1
HIDE KB2
WAITCELL 92 4
PRESS SETKA
WAITSTOP
FINISHPUNCH
PRESS CLEARKA
SELECT 3 48
LOADPUNCH pi2out.flx
PRESS START
WAITINPUT
FINISHPUNCH
QUIT
EOF
./GIER ./pi2.demo

./flx2a <pi2out.flx >pi2out.asc
./pi2binstat.pl pi2out.asc
./flx2ps -L -h60 -8 -f10 <pi2out.flx >pi2out.ps
ps2pdf pi2out.ps pi2out.pdf

date
kill $xpid
