On Sun, 2005-03-06 at 09:43 -0600, John Leo Zimmer wrote:

[KSB2] <...snip...>

> > [KSB] Try something like:
> > 
> > export DIALOG=${DIALOG:=`which Xdialog`} ; if [[ -z $DIALOG ]] ; 
> > then export DIALOG=`which dialog` ; fi
> > 
> > and in your script use $DIALOG as the program to use.  Now that I 
> > think about it, a construct like the following might be even better:
> > 
> > if [[ -z $DISPLAY ]] ; then export DIALOG=`which dialog` ; else ... 
> > ; fi
> > 
> 
> [jlz] OK, Thanks. That's what I needed. This works to test for both X and 
> Xdialog.
> 
> ######
> if [[ -z $DISPLAY ]] ; then dialog --infobox "X not running" 0 0 ; 
>      $vista_source/dvista ; exit 1
>   fi
> export XDIALOG=`which Xdialog`
> if [[ -z $XDIALOG ]] ; then dialog --msgbox "Xdialog not installed" 0 0 ;
>      $vista_source/dvista ; exit 1
>   fi
> ######

Try this (just 3 lines; watch out for line breaks):

export DIALOG=`which Xdialog`
if [[ -z $DIALOG || -z $DISPLAY ]] ; then export DIALOG=`which dialog` ;
fi
$DIALOG --title "Dialog Chooser Demo" --infobox "Using $DIALOG" 0 0

Sometime, I should probably update the vista script to allow dialog.
But Xdialog has more visual appeal.

-- Bhaskar


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to