- Display the default question dialog:zenity --question- Display an info dialog displaying the text "Hello!":zenity --info --text="[Hello!]"- Display a name/password form and output the data separated by ";":zenity --forms --add-entry="[Name]" --add-password="[Password]" --separator="[;]"- Display a file selection form in which the user can only select directories:zenity --file-selection --directory- Display a progress bar which updates its message every second and show a progress percent:[(echo "#1"; sleep 1; echo "50"; echo "#2"; sleep 1; echo "100")] | zenity --progress
zenity is a program that will display GTK+ dialogs, and return (either in the return code, or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts.
For example, zenity --question will return either 0, 1 or 5, depending on whether the user pressed OK, Cancel or timeout has been reached. zenity --entry will output on standard output what the user typed into the text entry field.
Comprehensive documentation is available in the GNOME Help Browser.
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-').
Text entry options
File selection options
Color selection options
Password dialog options
Forms dialog options
Also the standard GTK+ options are accepted. For more information about the GTK+ options, execute following command.
Normally, zenity detects the terminal window from which it was launched and keeps itself above that window. This behavior can be disabled by unsetting the WINDOWID environment variable.
Display a file selector with the title Select a file to remove. The file selected is returned on standard output.
Display a text entry dialog with the title Select Host and the text Select the host you would like to flood-ping. The entered text is returned on standard output.
Display a dialog, asking Microsoft Windows has been found! Would you like to remove it?. The return code will be 0 (true in shell) if OK is selected, and 1 (false) if Cancel is selected.
Show the search results in a list dialog with the title Search Results and the text Finding all header files....
Show a notification in the message tray
Display a weekly shopping list in a check list dialog with Apples and Oranges pre selected
Display a progress dialog while searching for all the postscript files in your home directory
find $HOME -name '*.ps' | zenity --progress --pulsate
Zenity was written by Glynn Foster <email@example.com>.
This manual page was written by Ross Burton <firstname.lastname@example.org>.