Zenity tutorial – Question dialog

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


zenity question 1

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

[codesyntax lang=”bash”]


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


Leave a Reply

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