Friday 27 September 2019

linux - Is there a way to show notification from bash script in Ubuntu?


Most of the application can show nicely formatted notification on events that appear on top right corner of the screen. I'm about to write a bash script that will do fairy long processing in the background and I really want to know when it is finished. How can I show that nice notification from a bash script?



Answer



If you're using the new notification system in Jaunty, you want the notify-send command


notify-send - a program to send desktop notifications

SYNOPSIS

With notify-send you can sends desktop notifications to the user via
a notification daemon from the command line. These notifications can be
used to inform the user about an event or display some form of information
without getting in the user's way.

OPTIONS

-u, --urgency=LEVEL
Specifies the urgency level (low, normal, critical).

-t, --expire-time=TIME
Specifies the timeout in milliseconds at which to expire the notification.
-i, --icon=ICON[,ICON...]
Specifies an icon filename or stock icon to display.
-c, --category=TYPE[,TYPE...]
Specifies the notification category.

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...