Zenity
Zenity [ zenətɪ ] is a platform-independent program that allows you to start GTK dialogs from the command line or from shell scripts.
Description
Zenity allowed, as well as similar programs whiptail and dialog easy creation of graphical user interfaces ( GUIs). Primary simple user dialogs can be generated. To represent complex data entry screens, the program is not suitable.
Platform independence
Zenity is bound to the GIMP Toolkit. In principle, therefore, is zenity on all GTK supported systems capable of running (Linux, BSD, Windows, Mac OS X). The elements necessary to establish the dialogues parameters are passed as command line options. Zenity can therefore be invoked by bash, python ( PyZenity ), Perl and other programs.
Example: Python script
From PyZenity import info Message from PyZenity import Question from PyZenity import ErrorMessage choice = Question ( " Please click on a button ' ) if choice: Info Message ( ' Yes pressed !') else: ErrorMessage ( 'No pressed !') Example: Linux Bash script
#! / bin / bash if zenity - question - text = " Please press a key. "; then zenity - info - text = " Yes pressed \! " else zenity - error - text = "No pressed \! " fi Example: Windows
@ echo off zenity - question - ok - label = " Yes " - cancel- label = "No " - ". Please press a key " text = if% ERRORLEVEL% == 1 goto error zenity - info - text = " pressed Yes! " goto end: error zenity - error - text = "No down! ": end alternatives
- Yad ( fork of zenity without obsolete libraries )
- Dialogue
- Xdialog
- Whiptail