Jul 112008

Zenity is an opensource tool that allows you to display Gtk+ dialog boxes from the command line and through shell scripts. It is similar to gdialog, but is intended to be saner. It comes from the same family as dialog, Xdialog, and cdialog, but it surpasses those projects by having a cooler name.

To install in openSUSE (here openSUSE 11.0)

opensuse11:~ # yast2 –install zenity

This should download and install the required dependencies and the zenity package on your system.

To check the path of the Zenity executable and confirm the proper installation of Zenity

opensuse11:~ # which zenity

Zenity can be called from scripts or command line and all the more important is it is very easy to use and the help option is quite well documented.

For instance,

To display a Warning message from command line

opensuse11:~ # zenity –warning –text=”Your computer will laugh in 10 seconds”

Funny Zenity Warning message

For details list of options and a further help on all these options,

opensuse11;~ # zenity –help
zenity [OPTION…]

Help Options:
-?, –help                  Show help options
–help-all                  Show all help options
–help-general              Show general options
–help-calendar             Show calendar options
–help-entry                Show text entry options
–help-error                Show error options
–help-info                 Show info options
–help-file-selection       Show file selection options
–help-list                 Show list options
–help-notification         Show notification icon options
–help-progress             Show progress options
–help-question             Show question options
–help-warning              Show warning options
–help-scale                Show scale options
–help-text-info            Show text information options
–help-misc                 Show miscellaneous options
–help-gtk                  Show GTK+ Options

Application Options:
–calendar                  Display calendar dialog
–entry                     Display text entry dialog
–error                     Display error dialog
–info                      Display info dialog
–file-selection            Display file selection dialog
–list                      Display list dialog
–notification              Display notification
–progress                  Display progress indication dialog
–question                  Display question dialog
–warning                   Display warning dialog
–scale                     Display scale dialog
–text-info                 Display text information dialog
–display=DISPLAY           X display to use