Zenity | |
Screenshot Size: | 255px |
Author: | Sun Microsystems |
Developer: | Glynn Foster Lucas Rocha |
Operating System: | Unix-like |
License: | GNU Lesser General Public License |
Zenity is free software and a cross-platform program that allows the execution of GTK dialog boxes in command-line and shell scripts.
Like tools such as whiptail and dialog, Zenity allows easy creation of GUIs, though it has fewer features than more complex GUI-creation tools.
, Zenity is available for Linux, BSD and Windows. A Zenity port to Mac OS X is available in MacPorts and Homebrew.
As of 2018, Zenity ports for Windows are available: zenity-windows (based on version 3.20.0) and winzenity (based on 3.8.0 / statically linked)
Zenity does not possess any built-in scripting capabilities and it must, therefore, rely on an interpreter for processing. To create a script that runs on more than one platform without extensive modifications, it would be best to use an interpreter that is available on the widest range of operating systems. One option is Python in combination with the PyZenity library.
choice = Question('Please press a button.')
if choice: InfoMessage('You pressed Yes!')else: ErrorMessage('You pressed No!')
if zenity --question --text="Please press a button."; thenzenity --info --text="You pressed Yes\!"elsezenity --error --text="You pressed No\!"fi
errorzenity --error --text="You pressed No!"
end