I started using Zenity years ago, when there wasn't much documentation and consequently didn't use the progress dialogue the right way. The result being that some scripts eventually broke. For example, there was no information on how to make the progress bar progress - so I only used the whirr-whirr pulsate effect.
No ProgressIn the past, I simply started a pulsater, pushed it into the background, saved the PID and later killed it when necessary, like this:
zenity --progress &
echo "Do something"
That used to worked fine, but recently on Fedora 22, it just sits there and does nothing. It won't even blink. Dead as a doornail. Bah, humbug...
When All Else Fails...Eventually, I found the documentation and RTFMed:
The problem is that the progress dialog has a new bug and it expects to receive something over stdin in order to get going. If it never gets anything, it does nothing - in previous versions it worked fine in the background, but no-more. When it is pushed into the background with &, it just sits there and sulks.
The correct way to make a progress pulsater that must do something and exit based on a condition, at which point one has to stop the pulsater, is like this:
while TRUE, do
echo "This Will Do Nothing"
echo "#Change The Text"
if [ "$CNT" -eq 10 ]; then
# Close the progress dialog with 100%
echo "Continue doing nothing"
) | zenity --progress \
--text="The Default Text" \
The --auto-close parameter will cause the progress dialogue to stop when you echo "100" percent.
An echo statement that starts with a # will change the text and one without, will be ignored. The --no-cancel will suppress the Cancel button, since it doesn't make sense.