Shell script – Zenity list dialog tutorial

July 5, 2014 | By | Reply More

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”]

[/codesyntax]

Insert the following lines

[codesyntax lang=”bash”]

[/codesyntax]

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

[codesyntax lang=”bash”]

[/codesyntax]

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.

Tags: , , ,

Category: Script

Leave a Reply