Zenity Command in Linux

Kaushik Denge
3 min readSep 24, 2021

--

Zenity is a program that will display GTK+ dialogs, and return (either in the return code, or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts.

* What is Zenity ?

Zenity is an open source and a cross-platform application which displays GTK+ Dialog Boxes in command-line and using shell scripts. It allows to ask and present information to/from shell in Graphical Boxes. The application lets you create Graphical dialog boxes in command-line and makes the interaction between user and shell very easy.

There are other alternatives, but nothing compares to the simplicity of Zenity, specially when you don’t need complex programming. Zenity, a tool you must have your hands on.

* Installation of Zenity in Linux

Zentity is by default installed or available in repository of most of the Standard Linux distribution of today. You can check if is installed onto your machine or not by executing following commands:

# zenity --version# whereis zenity

If it’s not installed, you can install it using Yum command as shown below:

# yum install zenity

* Features of Zenity

To read the manual of Zenity we will use the Command:

# man zenity

Some of the basic and very useful Dialogs of Zenity, which can be invoked directly from the command-line.

  • How about a quick calendar dialog?
# zenity --calendar
  • An error Dialog Box
# zenity --error
  • A General text Entry Dialog Box
# zenity --entry
  • An Information Dialog
# zenity --info
  • A question Dialog box
# zenity --question
  • A progress Bar
# zenity --progress
  • Scale Dialog
# zenity --scale
  • A Password Dialog
# zenity --password
  • A Form Dialog box
# zenity --forms
  • You can explore more about Zenity by using command :
# zenity --help
  • To know more about particular opation :
zenity --help-[option]
# zenity --help-info

Hope you like the blog and is helpful to you ! Thanks for your time :)

--

--

No responses yet