3 # Try to run "dia" with '-e' option, Xvnc wrapping if needed.
4 # Copyright (C) 2000,2003 Jan Kratochvil <project-macros@jankratochvil.net>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; exactly version 2 of June 1991 is required
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 if test "x@PATH_XVNC@" != "x@PATH_XVNC$empty@"
23 PATH_XVNC="@PATH_XVNC@"
25 if test "x@PATH_BC@" != "x@PATH_BC$empty@"
29 if test "x@PATH_DIA@" != "x@PATH_DIA$empty@"
37 if test "x$PATH_XVNC" != "x"
39 xport=$[($$%4096)+2000]
44 if test -r /proc/net/tcp -a "x$PATH_BC" != "x"
49 hex="`echo "obase=16;$[$xport+5900]"|$PATH_BC`"
50 if grep -q ":`echo "000$hex"|tail -c5` " /proc/net/tcp
74 export DISPLAY=":$xport"
75 $PATH_XVNC $DISPLAY & xpid=$!
80 if test "x$DISPLAY" = "x"
86 for opt in "--disable-crash-dialog" "";do
87 $PATH_DIA $opt "$@";r=$?
89 if test "x$xpid" != "x"