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

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

man zenity

It will show all the options

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=” Warning Temperature” --text “Temperature in High”

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”

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”

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”

You can build many more dialogs using zenity .

I hope you like this article about the zenity commands.

Thank you for reading this article ……😊😍

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store