User Tools

Site Tools


en:code:system:notify
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
en:code:system:notify [2021/02/13 11:23] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Notify ======
 +This object allows sending system notifications. It only works on GNU/Linux.
  
 +===== Functions =====
 +
 +==== Notify ====
 +Constructor function.
 +
 +=== Syntax ===
 +<code javascript>
 +var myObject = new Notify();
 +</code>
 +<code javascript>
 +var myObject = new Notify(parameters);
 +</code>
 +
 +=== 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 ===
 +<code javascript>
 +var myObject = new Notify();
 +</code>
 +<code javascript>
 +var myObject = new Notify({
 + title: "Hello",
 + text: "Hello automation world!"
 +});
 +</code>
 +
 +===== Methods =====
 +
 +==== show ====
 +Shows the notification.
 +
 +=== Syntax ===
 +<code javascript>
 +myObject.show();
 +</code>
 +<code javascript>
 +myObject.show(parameters);
 +</code>
 +
 +=== 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 ===
 +<code javascript>
 +myObject.show();
 +</code>
 +<code javascript>
 +myObject.show({
 + title: "Hello",
 + text: "Hello automation world!"
 +});
 +</code>
 +
 +=== Notes ===
 +If you want to update a notification's text re-use a single Notify object and call [[#show|show]] to change the text.
en/code/system/notify.txt · Last modified: 2021/02/13 11:23 by 127.0.0.1