#!/bin/bash

Xvfb :3 &
xpid=$!
export DISPLAY=:3

cp configs/drumtjek.gier default.gier

cat >pi2.demo <<EOF
HIDE KB1
HIDE KB2
LOADREADER tapes/mk/pi2bin.asc
LOADPUNCH 00.flx
WAITINPUT
PRESS SETKA
$(./maketext.sh 'r<')
WAITSTOP
PRESS CLEARKA
PRESS START
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
./flx2ps -L -h60 -8 -f10 <pi2out.flx >pi2out.ps
ps2pdf pi2out.ps pi2out.pdf

kill $xpid
