en:code:system:notify
Notify
This object allows sending system notifications. It only works on GNU/Linux.
Functions
Notify
Constructor function.
Syntax
var myObject = new Notify();
var myObject = new Notify(parameters);
Arguments
- parameters - (object) the message parameters
- title - (string) the notification's title
- text - (string) the notification's text
- icon - (string) the notification's icon name or path to an image file (see http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html)
- timeout - (integer) the notification's timeout. It is ignored on some OSes like Ubuntu
Example
var myObject = new Notify();
var myObject = new Notify({ title: "Hello", text: "Hello automation world!" });
Methods
show
Shows the notification.
Syntax
myObject.show();
myObject.show(parameters);
Arguments
- parameters - (object) the message parameters
- title - (string) the notification's title
- text - (string) the notification's text
- icon - (string) the notification's icon name or path to an image file (see http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html)
- timeout - (integer) the notification's timeout. It is ignored on some OSes like Ubuntu
Returns
- (Notify) this Notify
Exceptions
- (NotificationError) unable to show the notification
Example
myObject.show();
myObject.show({ title: "Hello", text: "Hello automation world!" });
Notes
If you want to update a notification's text re-use a single Notify object and call show to change the text.
en/code/system/notify.txt · Last modified: 2021/02/13 11:23 by 127.0.0.1