User Tools

Site Tools


en:code:system:notify

Differences

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

Link to this comparison view

en:code:system:notify [2020/02/09 13:26] (current)
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: 2020/02/09 13:26 (external edit)