Atharva Jagtap
4 min readSep 22, 2021

--

Zenity is a program/tool in Linux which create simple dialog box that interact graphically with the user. And this tool follows the usual GNU command line syntax, with long options starting with two dashes (`-’).

Zenity is a GUI tool which has many Dialog options performing different GUI operations. And to see this eatures of we should first install the zenity package using yum.

Command to install the Zenity program -

$ sudo yum install zenity -y

And to see its features we type command “man” Manual command -

$ man zenity
man command
man shows the document of Zenity tool
Zenity Dialog options

Now I will show you some of the options, about how to use these Zentiy Dialog options, and can we add different options together?. This is all we are going to see now -

  1. Entry Dialog Option :-

Command to perform Entry Dialog Option -

$ zentiy --entry

Entry Option show’s a pop up with a text box to enter any text you want and the text that you have typed in the text box will be displayed on the Shell prompt/terminal

Fig(1) Entry Dialog Option
Fig(2) Entry Dialog Option

2. Info Dialog Option -

Info Dialog Option display a info pop up with some info

$ zenity --info

You can also add your text in the Info Dialog option using “text” Dialog option to set the text in the Info Dialog option.

$ zenity --info --title='Name' --text='Mr.Atharva Jagtap'

3. Error Dialog Option -

Error Dialog Option display an error pop up with some message on it.

$ zenity --error

4. Forms Dialog Option -

Forms Dialog Option display a blank space pop up window for you and yes you can modify the forms as per your need and make something of it , that I’m going to show it you at the end of this blog “how to do that ?”.

$ zenity --forms

4. Calendar Dialog Option -

Calendar Dialog Option display the calendar pop up window with date which is registered on your laptop and after closing the pop up window you see the date on your shell prompt.

$ zenity --calendar
Fig(1) Calendar Dialog Option
Fig(2) Calendar Dialog Option

You can also change the date format as it shows on the shell prompt and this command to change the format -

$ zenity --calendar --date-format='%Y %m %d'
Fig(1) Calendar date format Dialog Option
Fig(2) Calendar date format Dialog Option

Another thing you can also add “%A” to see the day of the date

Fig(3) Calendar date format Dialog Option

Now I’m going show how add different Options together

Here, as I have informed you earlier about the forms dialog option, so I have utilized the forms option to create a simple pop up window which show the title as Atharva and and the text inside the form in the middle with the calendar shows the Today’s date (the date which is displaying on your laptop)

$ zenity -- forms --title='Atharva' --add-calendar='Todays Date'

I hope that you have enjoyed the article and learned a new concept today :D

Thank you for reading my blog !!

--

--