Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Features:
Fixes:

- Windows: `WindowsToaster` now accepts `remove` without a `message`, the same as `close` ([#431](https://github.com/mikaelbr/node-notifier/issues/431)).
- Docs: adds README troubleshooting for cron, PM2 and services ([#226](https://github.com/mikaelbr/node-notifier/issues/226), [#333](https://github.com/mikaelbr/node-notifier/issues/333)).
- Windows: updates the bundled 64-bit SnoreToast to 0.9.1, so clicks and action buttons are reported back when using a custom `appID` ([#326](https://github.com/mikaelbr/node-notifier/issues/326), [#332](https://github.com/mikaelbr/node-notifier/issues/332), [#375](https://github.com/mikaelbr/node-notifier/pull/375)). The binary is KDE's own build of the official release. The 32-bit binary stays on 0.7.0, as KDE publishes no 32-bit build. Note that the new binary is not code-signed.
- Windows: fixes `notify` throwing in `cluster` worker processes ([#410](https://github.com/mikaelbr/node-notifier/issues/410)).

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,22 @@ point `customPath` to it.
See [Issue #71 for more info](https://github.com/mikaelbr/node-notifier/issues/71)
<https://github.com/mikaelbr/node-notifier/issues/71>.

### Notifications from cron, PM2 or services

Notifications are shown on the desktop of the logged-in user, so the process must run as that same user, while they are logged in.

**Linux:** cron and some process managers start without the user's session environment, so `notify-send` can't reach the session bus. Set `XDG_RUNTIME_DIR`, and `DBUS_SESSION_BUS_ADDRESS` if that isn't enough. On a standard systemd user session they are:

```sh
* * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus node /path/to/app.js
```

With PM2, start it as the desktop user (not root), or set the same variables in its environment.

**Windows:** services running as `SYSTEM` can't show notifications on the user's desktop. Set the service (or PM2) to log on as the logged-in user's account.

See [#226](https://github.com/mikaelbr/node-notifier/issues/226) and [#333](https://github.com/mikaelbr/node-notifier/issues/333).

### Within Electron Packaging

If packaging your Electron app as an `asar`, you will find `node-notifier` will fail to load.
Expand Down
Loading