Boost your zenity manual
Hello everyone!πββοΈπββοΈπββοΈ
In this blog, we will read about zenity command and itβs various tool

What is zenity?
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.
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.
[root@localhost ~]# zenity --version[root@localhost ~]# whereis zenity
If itβs not installed, you can install it using Yum command as shown below.
[root@localhost ~]# yum install zenity
There are various commands of zenity, few of them are listed below:
To read the complete manual of zenity, we use:
[root@localhost ~]# man zenity

Zenity basic dialog boxes
Some of the basic Dialogs of Zenity, which can be invoked directly from the command-line.
- How about a quick calendar dialog?
[root@localhost ~]# zenity --calendar
2. An error Dialog Box
[root@localhost ~]# zenity --error
3. A General text Entry Dialog Box
[root@localhost ~]# zenity --entry
4. An Information Dialog
[root@localhost ~]# zenity --info[root@localhost ~]# zenity --info --title="Welcome to my Blog" --text="How's your day"
5. A question Dialog box
[root@localhost ~]# zenity --question
6. A progress Bar
[root@localhost ~]# zenity --progress
7. Scale Dialog
[root@localhost ~]# zenity --scale
8. A Password Dialog
[root@localhost ~]# zenity --password
9. A Form Dialog box
[root@localhost ~]# zenity --forms
10. An about Dialog
[root@localhost ~]# zenity --about


Now we will discuss about displaying result of linux command inside zenity information dialog box. Although we can run these command directly inside the terminal see output there but how about creating dialog box which can display of output linux command inside it.
How about displaying current date and time inside dialog box.
[root@localhost ~]# zenity --info --text="$(date)" --title="Your current date and time is displayed below"

Now we will discuss about how to link two dialog boxes. How about an interactive dialog box which takes input from you, and shows the result. In this we linked two dialog boxes the detailed procedure is shown below:
- create a file containing below lines of code using any text editor like gedit/nano/vim.
#!/bin/bash
first=$(zenity --title="Your's First Name" --text "What is your first name?" --entry)
zenity --info --title="Welcome" --text="Mr./Ms. $first"
last=$(zenity --title="Your's Last Name" --text "$first what is your last name?" --entry)
zenity --info --title="Nice Meeting You" --text="Mr./Ms. $first $last"

2. Save manually it to any name with .sh extension like in this case it is saved to name.sh
3. Then make it executable, set the permission 775 on it.
[root@localhost ~]# chmod 775 name.sh
4. Run the file.
[root@localhost ~]# sh name.sh




This is how we can create interactive dialog boxes. For more information on how to create custom dialog boxes, visit at following reference page Zenity.
https://help.gnome.org/users/zenity/stable/
One can directly ask for help regarding zenity by typing the following command in terminal:
[root@localhost ~]# zenity --help
Thank youβ¦..