Saving my sanity with Zenity : shell script interaction via the GUI

Written By
Web Webster
Web Webster
Feb 5, 2009

[ Thanks to steve
hill
for this link. ]

“Zenity is not a unique tool (it’s similar to
dialog and Xdialog etc.) and not the first of its kind either, but
it is very usable. The FSF directory page says that “Zenity
lets you display Gtk+ dialog boxes from the command line and
through shell scripts” and I can find no better way of
summarising it. Put another way though, Zenity allows a shell
script to interact with a GUI user in a mutually beneficial way.
Sometimes your shell script needs to ask the user a question:
Zenity gives them a familiar dialog window and accepts the answer
accordingly. The end user need not even be aware that they are
running a shell script.

“Hello world!
As mentioned, you can put shell commands into scripts to be
executed. The same applies the other way around. You can take a
script command and run it directly in the shell if you want. In the
case of Zenity this is less useful unless you are doing for testing
purposes though. To give a simple example in the standard fashion
this is how you would get Zenity to display an information dialog.
Assuming you have Zenity installed (it’s a package on most
GNU/Linux systems so just search for it in your usual
package/software manager), type this directly into a GUI terminal
emulator (xterm etc.) and see what you get:”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.