Quote:
Originally posted by Andy@DP
How do you use the Xdialog? I know you said GTK so can that be called from a bash script?
|
Yes. It's made for that. Try:
Code:
#!/bin/bash
if Xdialog --yesno "Yes or No" 10 30 ; then
echo "huh huh...you said \"yes\""
else
echo "so \"no\" it is..."
fi
And here's an example for a progress bar in Xdialog from a bash script:
Code:
#!/bin/bash
PIPE="/tmp/pipe_$$"
set -m
mkfifo "$PIPE"
Xdialog --ignore-eof --gauge Aloha 10 30 <"$PIPE" &
for i in `seq 0 20 100` ; do
echo $i >"$PIPE"
echo "$i%"
sleep 1
done
jobs -x kill %%
rm "$PIPE"
For other options see its man page: man xdialog