zenity : dialogs from command line and shell script

zenity is a tool for displaying gtk+ dialogs from command line or shell scripts. It can be used for displaying various kind of dialog boxes.

It is easy to use zenity for simpler applications compared to writing a GTK based program.

Following are some of dialogs that can be created using zenity.

  • Read text (entry)


  • hash@ssl50:~$ name=`zenity --entry --title="Example" --text="Your name please"`



  • Calendar


  • hash@ssl50:~$ zenity --calendar --title="Example" --text="Select the day"


  • Filechooser


  • hash@ssl50:~$ filename=`zenity --file-selection`



  • Question

    hash@ssl50:~$ zenity --question --text="Are you sure ?" ; echo $?



Check man page of zenity for more information.

0 comments: