Now that we were talking about sensible scripts I would suggest
adding a 'sensible-dialog' to Debian, we have many packages using term's
dialog to allow for some kind of simple user GUI in console, I found out,
however that gnome provides a 'gdialog' quite the same but that gives new
light (when working in X) to all those scripts using dialog. Its prettier to
see the gnome widgets that a blue-background xterm, IMHO.
I suggest using a 'sensible-dialog' that would give gdialog if
installed and in X and dialog otherwise. I have used this myself in some
scripts and would like to suggest all developers to use something similar in
theirs:
#!/bin/sh
...
#Init Diaglo
GDIALOG="/usr/bin/gdialog"
DIALOG="/usr/bin/dialog"
if [ -x $GDIALOG ] ; then
DIALOG=$GDIALOG
fi
if [ ! -x $DIALOG ] ; then
echo "Sorry, you do not have dialog installed."
echo "Dialog is installed by the 'dialog' package"
# if this shows up the package has a bug, since should have a Depends:
exit 1;
fi
(... continue with script)
a 'sensible-dialog' would do
if X and exists gdialog
use gdialog
else
if exists dialog
use dialog
else
exit 1
Well I think this is a nive idea, ¿any comments? are other
developers willing to add this, could this be provided?
Regards
Javi