Zenity World

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

Lets, explore the zenity using the options

Message Dialogs

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

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

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”
  • zenity — file-selection — text=select a file”
  • zenity — progress — text=”updating system”

--

--

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