Domanda

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.

È stato utile?

Soluzione

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 :)"

Altri suggerimenti

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top