[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] poor man's wysiwyg for groff/gv
From: |
Ted Harding |
Subject: |
Re: [Groff] poor man's wysiwyg for groff/gv |
Date: |
Mon, 17 Dec 2001 20:28:48 -0000 (GMT) |
On 17-Dec-01 Ralph Corderoy wrote:
> Hi Ted,
>
>> Well, in "me-too" mode, I append the core of a script
>
> Don't think it made it through the list-mangler.
Oops!! Here it is this time! The list-mangler was me.
Thanks, Ralph.
Ted.
(By the way, 'gv' is not in watch mode! That was a
memory from an early version. Also, forgot to mention
that if you close 'gv' (e.g. by typing "q" on it)
you bring the cycle to a close.)
==================================================
#! /bin/bash
export gv_PID=$!
export trname="`dirname $1`/`basename $1 .tr`"
## Normal
export GROFFge="groff"
export MODEge="Portrait"
export GEOMgv="978x820-0+0"
export GEOMge="80x36+127+0"
## Landscape
if [ "`basename $0`" = "ge_L" ] ; then
export GROFFge="groff -P-l -rPL=8.267 -rLL=9.693"
echo "Landscape Mode"
export MODEge="Landscape"
export GEOMgv="1100x750-0+0"
export GEOMge="80x47+255+0"
else
echo "Portrait Mode"
fi
touch $trname.tr
touch $trname.watch
touch $trname.ps
export grDATE="`date +'%-d %B %Y'`"
if [ ! -s $trname.tr ] ; then
echo -n ".ds DATE " > $trname.tr
date +'%-d %B %Y' >> $trname.tr
echo -n ".\\\".ds DATE \\*[grDATE]" >> $trname.tr
fi
if [ ! -s $trname.ps ] ; then
echo '%!PS-Adobe-3.0' > $trname.ps
fi
xterm -name "GE_aux" -title "GE_x_$trname" \
-geometry 80x36+0-0 &
export AUX_ID=$!
xterm -name "GE $trname.tr" -title "GE $trname.tr" \
-geometry $GEOMge -fn 10x20 \
-e vim $trname.tr &
gv -scale 2 -antialias -spartan \
-geometry $GEOMgv $trname.ps &
export gv_PID=$!
export gvpid=$!
echo $gvpid
ps -ax | grep gv | grep -v grep
### while true ; do
while [ -n "`ps -ax | grep -v grep | grep $gvpid`" ] ; do
if [ $trname.tr -nt $trname.watch ] ; then
touch $trname.watch
$GROFFge -Tps -dgrDATE="$grDATE" -tpe -ms -mted $trname.tr >
$trname.ps
kill -1 $gv_PID
### sleep 2
fi
done
rm $trname.watch
kill -15 $AUX_ID
===========================================================
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 17-Dec-01 Time: 20:28:48
------------------------------ XFMail ------------------------------