Skip to content

Notifications

Tell the user something without covering anything, wherever they are:

  • you, an agent: omfp_call agents.notify { title, body, urgency? } (it opens your thread), once per occasion — a long task finished, you need them — never for progress;
  • a widget: useNotify(); a window module: omfp.notify; jobs and scripts: notify.send with the user token. These take { title, body, threadId?, url?, tag?, urgency? }.

The daemon picks where: the omfp window that has the focus shows a notice at the right end of the mode line (◆ title body, gone after 8 s; a click or :notice opens it); with none focused, the most recently focused window shows a system notification, and every browser or phone subscribed to Web Push gets it too. urgency: "high" reaches the phones even while a window has the focus. Only omfp windows count (those windows.list lists): a script’s own connection (omfp call) is never where a notification goes.

Notifications are text only. Opening one selects threadId’s thread, else goes to url (a path of the UI). A newer notification with the same tag replaces the older on every device. A browser subscribes once its window may notify (an installed app on a phone included, over HTTPS); :push off / :push on switch it, push.devices lists them; the desktop app’s windows never subscribe. The setting ui.notifications: "never" (omfp://docs/settings) shows neither notices nor system notifications.

For the result of something the user just did in a widget (Copied …, a failure), use toasts instead: useReportSuccess(), useReportError().