Explore zenity Linux command Options

Explore zenity Linux command Options

In this article, we will read about zenity then explore zenity options.

What is Zenity?

Zenity is a command-line GUI creator program that will display GTK dialogs and return the User's input. It is preinstalled on versions of Linux. Zenity is also available for macOS and Windows. it works well for simple Bash scripts. Zenity supports:

  • Basic forms
  • Calendar dialogs
  • Color selection dialogs
  • List Dialog
  • Message and Notification Dialog
  • Progress bars and Scales
  • Text Entry and Text Information Dialogs

Let's explore it!

Using the manual, we can list all the available options of zenity, and command in below

man zenity        

It will show all the options

No alt text provided for this image






No alt text provided for this image






and More options

Lets, explore the zenity using the options

1. Message Dialogs

To Show the warning message box. we can use the below command

zenity --warning --title=” Temperature Warning” --text “Temperature in High”        


No alt text provided for this image


2. Create Login form

If you can create multi-entry forms using Zenity. A form can be built using text fields, password fields, and calendars.

zenity --forms --title=”Login Form” --text “Login” --add-entry=”User Name” --add-calendar=”Date of Birth” --add-password=”password” --cancel-label=”Go Back”        


No alt text provided for this image

3. Motor Controller

It’s possible to add some extra buttons. Below is an example where Motor is controlled with a zenity multi-button info dialog option.

zenity --info --title=”Motor Control” --text “Motor Action control” --ok-label=”Start” --extra-button=”Stop”--extra-button=”Forword” --extra-button=”Backword”        


No alt text provided for this image

4. List Dialog -Fast Food list

If you are working with a simple known data set then the List Dialog might be a good fit. Below is an example of where Fast Food list. In this Dialog select the food which you like.

zenity --list --title “Fast Food --text “Select the food which you like” --checklist --column “Select” --column “Name” 1 “Sandwich” 2 “Burger” 3 “Pizza” 4 “Panipuri” 5 “Pasta”        


No alt text provided for this image

You can build many more dialogs using zenity .

I hope you like this article about zenity commands.

Thank you for reading this article ……😊😍

Dayal Nigam

Software Developer at Agile Connects Pvt. ltd.

3y

Astonishing 😮🤘Tinkal Shakya

Like
Reply
Shrishti Kapoor

Snr. DevOps Engineer@Accenture | 4 x RedHat Certified | Aviatrix Certified Engineer | AI-900 | Trainer, Mentor, Judge @Hackathon | Technical Research Writer Enthusiast 🔷DevOps 🔷Cloud-AWS, Azure 🔷ML/AI/DL 🔷Python DSA

3y

Good Work💫

Shobhit Sharma

Safeguarding🎲@ Zupee | Ex-Airtel, Paytm

3y

The Zenity thing is very interesting, try to pop up zenity dialog box using Ansible on Managing Node using Controller Node :)

Like
Reply
Shobhit Sharma

Safeguarding🎲@ Zupee | Ex-Airtel, Paytm

3y

Great Work! :)

To view or add a comment, sign in

More articles by Tinkal Shakya

Insights from the community

Others also viewed

Explore topics