Zenity create a notification icon

Share this post to your friends !

This entry is part 3 of 13 in the series GUI for bash script using Zenity

WriteBash - To create a notification icon in zenity, use the --notification option. This article will guide you fully on this option of zenity. This option is quite interesting, you can write a bash script using this option to display task reminders for you.

Create a notification icon

To create a notification icon with zenity, just type the following command, replace the text of your text into the command.

zenity --notification --text="Demo text content - WriteBash.com"
zenity-create-a-notification-icon-01 Zenity create a notification icon
Demo zenity create notification

As you can see in the image above, a small message window appears at the top of the screen.

All options of notification

To display other options that --notification support, you type the following command:

zenity --help-notification
zenity-create-a-notification-icon-02 Zenity create a notification icon
Display other options of notification
Notification options
--notificationDisplay notification. This is the main option use to create a notification icon.
--text=TEXTSpecifies the text that is displayed in the notification area. Example: –text=”Demo text – WriteBash.com”
--listenListen for commands on stdin. Commands include ‘message’, ‘tooltip’, ‘icon’, and ‘visible’ separated by a colon. For example, ‘message: Hello world’, ‘visible: false’, or ‘icon: /path/to/icon’. The icon command also accepts the four stock icon: ‘error’, ‘info’, ‘question’, and ‘warning’
--hint=TEXTSet the notification hints. Almost not use. Example: –hint=urgency

If you look at the table above, the --notification and --text options are easy to understand and use. I also had the example above.

Of the two remaining options, the --hint option is almost useless. About --listen option, how to use it?

Read moreCreate calendar dialog with Zenity

Okey, I’ll try using it as I wrote in the table above. I’ll using --listen with message command.

zenity --notification --text="Demo text content - WriteBash.com" --listen
zenity-create-a-notification-icon-03 Zenity create a notification icon
Use zenity notification with –listen option

In the image above, you can see that if you use the --listen option, it will wait for you to enter the command into the terminal window. In the demo I used the message command, you see that it prints the text content of the message command instead of the text of the --text option.


The --notification option in zenity is very simple, it helps you create a notification icon easily and quickly. What is the idea of using it? You can write a bash script, which is a feature that checks your work hours and tells you when it’s time for dinner.

Continue reading the series«« Previous part: Bash create calendar dialog with ZenityNext part: Zenity create color selection dialog »»
If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.

Share this post to your friends !
If you appreciate what we share in this blog, you can support us by:
  1. Stay connected to: Facebook | Twitter | Google Plus | YouTube
  2. Subscribe email to recieve new posts from us: Sign up now.
  3. Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
  4. Become a Supporter - Make a contribution via PayPal.
  5. Support us by purchasing Ribbon Lite Child theme being using on this website.

We are thankful for your support.

single post bottom banner
«« »»

Got something to say? Join the discussion

Please keep in mind that all comments are subject to our Comment Policy. Your email address will not be published.
This site uses Akismet to reduce spam. Learn how your comment data is processed.