Shell script – Zenity list dialog tutorial

On this Shell script tutorial, I am going to learn how to show a list dialog using Zenity. Zenity list dialog provide an interesting way to show a list box/list dialog using Shell script. See the example below:

Create a new file

[codesyntax lang=”bash”]


Insert the following lines

[codesyntax lang=”bash”]


Then save it and make it executable then, run it.

[codesyntax lang=”bash”]


The code above will list any files with DEB extension under /home/dhani/Downloads directory.

zenity list dialog 1

When you click a DEB file from the list and press OK, it will display an info dialog.

zenity list dialog 2

When OK button pressed without selecting any file, it will show

zenity list dialog 3

Thank you see you on the next Shell Script tutorial.



Leave a Reply

Your email address will not be published. Required fields are marked *