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:
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
and More options
Lets, explore the zenity using the options
Recommended by LinkedIn
1. Message Dialogs
To Show the warning message box. we can use the below command
zenity --warning --title=” Temperature Warning” --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 zenity commands.
Software Developer at Agile Connects Pvt. ltd.
3yAstonishing 😮🤘Tinkal Shakya
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
3yGood Work💫
Safeguarding🎲@ Zupee | Ex-Airtel, Paytm
3yThe Zenity thing is very interesting, try to pop up zenity dialog box using Ansible on Managing Node using Controller Node :)
Safeguarding🎲@ Zupee | Ex-Airtel, Paytm
3yGreat Work! :)