[GRASS-user] i.vpoints

Hamish hamish_nospam at yahoo.com
Wed Jun 28 07:18:16 EDT 2006


Paul Kelly wrote:

> > I haven't seen a GUI solution to force a terminal start, so I'm
> > going to revert the G_parser() change for i.vpoints, i.points, and
> > r.digit.
> 
> Not totally sure what you mean but does
> GRASS_UI_TERM=1
> export GRASS_UI_TERM
> 
> not do this? Stops a Tcl/Tk dialog box popping up and the old command
> line parser interface appears anyway.

Yes! Exactly what I need. Thanks.


I've reworked lib/init/grass-run.src  (-> $GISBASE/etc/grass-run.sh)
see below

It still doesn't work 100% (from gis.m i.group doesn't find maps*,
r.digit can't find selected monitor), but it lets us have those modules
use G_parser().

[*] I_get_group_ref() fails if @mapset is attached to group name, I
should have this fixed soon.


To prevent the GUI startup from the command line, in each term-only module
we can add:
 
    /* must run in a term window */
    setenv("GRASS_UI_TERM","1",TRUE);

before  G_gisinit (argv[0]); 

ie these ones:

g.access
g.setproj
d.font
r.digit
r.le.setup
d.rast.edit
i.points
i.vpoints
i.ortho.photo
i.class


look ok?

Hamish


==== grass-run.sh ==================================================

#!/bin/sh
# script to launch GRASS commands

# force command line startup mode
GRASS_UI_TERM=1
export GRASS_UI_TERM


# workaround for systems with xterm is setuid/setgid
#  http://grass.itc.it/pipermail/grass5/2004-September/015409.html

LD_LIBRARY_PATH_VAR=$GRASS_LD_LIBRARY_PATH
export LD_LIBRARY_PATH_VAR

# run command
$@

EXIT_VAL=$?
if [ $EXIT_VAL -ne 0 ] ; then
   echo
   echo "ERROR: $1 exited abnormally. Press <enter> to continue."
   read
fi

exit $EXIT_VAL




More information about the grass-user mailing list