Zenity display text in message dialog

by Daniel Pham
Published: Updated:
This entry is part 12 of 13 in the series GUI for bash script using Zenity

Zenity supports a number of message types. This article will guide you through these types of messages. To make the message dialog very simple, just use the --text option with the message type option.

The dialog dialog dialog supports the following four message types:

  • Information
  • Question
  • Warning
  • Error

Create an information dialog

To create the information dialog, use the following command:

zenity --info --text="WriteBash.com demo info message dialog"

And see the result as image below.

Zenity display text in message dialog
An information dialog.

Create a question dialog

To create a question dialog, use the following command:

zenity --question --text="Do you like WriteBash blog?"

And see the result as image below.

Zenity display text in message dialog
A question dialog.

Create a warning dialog

Read moreCreate a form dialog.

Use the following command to create a warning dialog:

zenity --warning --text="WriteBash.com demo a warning message"

And see the result as image below.

Zenity display text in message dialog
A warning dialog.

Create an error dialog

Use the following command to create an error dialog:

zenity --error --text="WriteBash demo an error message"

And see the result as image below.

Zenity display text in message dialog
An error dialog.

Conclusion

Through this article, you can create simple message dialogs. Supports 4 types of message dialog, you can use it flexibly. And I think that these dialogs will be used a lot in your program.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series Navigation«« Previous part: Zenity create a text entry dialogNext part: Zenity create a text information dialog »»

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.