Zenity tutorial – Question dialog

July 4, 2014 | By | Reply More

This Shell script tutorial will show you how to show a Question dialog using Zenity. Question dialog can be shown easily using –question option. Then, we can catch the user input based on which button is pressed by user. Here is the basic example of Zenity Question.

Create a new file for example question.sh and paste this lines:

[codesyntax lang=”bash”]

[/codesyntax]

zenity question 1

To catch the user input, we can add more lines such as:

[codesyntax lang=”bash”]

[/codesyntax]

The above script will display the same dialog as the previous script. But, when user press Yes or No, the info box will be shown as below.

zenity question 2

Tags: , ,

Category: Script

Leave a Reply