Zenity Command*

Rohit Dhore
3 min readSep 18, 2021

* What is zenity in linux

Zenity is an open source and a cross-platform application which displays GTK+ Dialog Boxes in co

mmand-line and using shell scripts. It allows to ask and present information to/from shell in Graphical Boxes. The application lets you create Graphical dialog boxes in command-line and makes the interaction between user and shell very easy. The command was created by

*Zenity Features

  1. FOSS Software
  2. Cross Platform Application
  3. Allow GTK+ Dialog Box Execution
  4. Command Line Tool
  5. Support in Shell Scripting

Basic Usage

When you write scripts, you can use Zenity to create simple dialogs that interact graphically with the user, as follows:

  • You can create a dialog to obtain information from the user. For example, you can prompt the user to select a date from a calendar dialog, or to select a file from a file selection dialog.
  • You can create a dialog to provide the user with information. For example, you can use a progress dialog to indicate the current status of an operation, or use a warning message dialog to alert the user

Basic Features of Zenity Command

$ zenity — info:- When we run this command a basic info dialog box will appear we can press ok to close it.

zenity — info

$ zenity — entry:- It will open a dialog box will a cursor blinking where we can enter any text we want and if we press ok that text will be printed on the terminal .

zenity — entry

$ zenity — question:- Command will open a dialog box with question on it we can click yes or no .

zenity — question

$ zenity — calendar:- It will show calendar of current year with month we can do changes in it like change the month ,date , select a date then press ok so, it will print the date which we have selected

zenity — calendar

Adavnce Features of Zenity Command

We can also integrate the various option in zenity to create some customized dialog box here are some exmaples of that.

$ zenity — entry — title=”Birthday month”— text=”$(cal)”

zenity — entry — title=”Birthday month” — text=”$(cal)”

$ zenity — question —text “Arth technical session at 7:30pm IST” — no-wrap — ok-label ‘yes’ — cancel-label ‘no’

~Thanks for reading

--

--