Function Repository Resource:

SystemNotifier

Source Notebook

Create a system tray icon that can be used to issue system notifications

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["SystemNotifier"]["Create","name"]

creates a ResourceFunction["SystemNotifier"] object with the given "name".

ResourceFunction["SystemNotifier"]["Remove","name"]

removes the ResourceFunction["SystemNotifier"] object with the given "name".

ResourceFunction["SystemNotifier"]["name"]

gives the ResourceFunction["SystemNotifier"] object corresponding to the given "name".

ResourceFunction["SystemNotifier"][][message]

generates a system notification displaying the text specified in message.

ResourceFunction["SystemNotifier"][][label,message]

generates a system notification with a heading specified by label.

Details and Options

ResourceFunction["SystemNotifier"] is not supported on every platform.
Notification appearance and behavior are platform dependent.
Options can be specified when creating a system notifier to customize appearance:
"Icon"the icon appearing in the system tray
"Tooltip"Nonethe tooltip that appears when mousing over the system tray icon
AppearanceNonethe name of a notification style
Some possible values for Appearance are:
Nonethe default notification appearance
"Information"supported only on Windows
"Warning"supported on Windows and macOS
"Error"supported on Windows and macOS

Examples

Basic Examples (2) 

Create a system notifier object:

In[1]:=
ResourceFunction["SystemNotifier"]["Create", "MyNotifier"]
Out[1]=

Trigger a system notification:

In[2]:=
ResourceFunction["SystemNotifier"][
  "MyNotifier"]["Test notification, please ignore"]

Remove the notifier:

In[3]:=
ResourceFunction["SystemNotifier"]["Remove", "MyNotifier"]

Create a system notifier with a customized appearance:

In[4]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/1a17b1f8-8ae5-407e-9379-92d0ef212b81"]
Out[4]=

Generate a system notification:

In[5]:=
ResourceFunction["SystemNotifier"]["BirdNotify"]["Hello world"]

Include additional text:

In[6]:=
ResourceFunction["SystemNotifier"][
  "BirdNotify"]["Message from Birdnardo", "That's pretty neat!"]

On some platforms, the appearance can be customized:

In[7]:=
ResourceFunction["SystemNotifier"][
  "BirdNotify"]["Warning from Birdnardo", "This is a pretty serious warning!", Appearance -> "Warning"]
In[8]:=
ResourceFunction["SystemNotifier"][
  "BirdNotify"]["Now you've done it!", "I told you so!", Appearance -> "Error"]

Remove the notifier:

In[9]:=
ResourceFunction["SystemNotifier"]["Remove", "BirdNotify"]

Scope (3) 

Creating multiple notifiers results in multiple system tray icons:

In[10]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/750d8269-dd6d-4a10-8083-7a18bc6ebd72"]
Out[10]=

Get all currently active notifiers:

In[11]:=
ResourceFunction["SystemNotifier"][All]
Out[11]=

Remove all notifiers:

In[12]:=
ResourceFunction["SystemNotifier"]["Remove", All]
Out[12]=

Version History

  • 1.0.0 – 27 May 2020

License Information