Question

I want to show an info box, or a general message, while running a command in background but i can't find an option to do so with zenity. Is it possible in the first place?

An example would be this, for better explanation

#!/bin/bash
zenity --info --text "I'm doing big things behind this window!"
any_command

With this, any_command (which obviously is a placeholder for... any command you'd like:D) will be execute ONLY AFTER I close the info window. Can I have the two running at the same time without using a progress bar? And is it possible, when any_command finishes, killing the previous info window and display another? (Or change the text in the first one, it does not matter...)

I could do

zenity --info --text "I've done this: `any_command`"

but that leaves me without any notice about what's happening.

Was it helpful?

Solution

How about sending your first zenity to the background, and killing it when the command is done?

#! /bin/bash
zenity --info --text="Running something, sit tight." &
zpid=$!
sleep 10
kill $zpid
zenity --info --text="Done :)"

OTHER TIPS

Try this at the command line:

zenity --info --text="listing files" && ls -l > temp.txt |\
  zenity --progress --pulsate && \
  zenity --text-info --filename=temp.txt --width=800 --height=600
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top