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"
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:
|Display notification. This is the main option use to create a notification icon.|
|Specifies the text that is displayed in the notification area. Example: –text=”Demo text – WriteBash.com”|
|Listen 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’|
|Set the notification hints. Almost not use. Example: –hint=urgency|
If you look at the table above, the
--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 more: Create 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
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
--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.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.