Send a desktop notification.
This serves as both a library for sending desktop notifications with zero config and a package of integrations.
(straight-use-package
'(startup-notification
:host github
:repo "kisaragi-hiu/send-notification"))
The entry point is send-notification
.
(send-notification "Some text")
Keyword arguments:
:body
: the body text of the notification.:app-name
: defaults to Emacs:icon
: only works for notify-send, an icon name to pass to it
Send a notification on startup.
(when (daemonp)
(send-notification-on-startup-mode))
When a Magit command encounters an error in the background, send a desktop notification.
(with-eval-after-load 'magit
(send-notification-on-magit-error-mode))
(Notification is only sent if no Magit buffers are displayed.)
The (attempted) support for Windows is lifted from alert-toast, © 2020, 2022 Grzegorz Kowzan.
- alert is the most full-featured, but it really is a
message
replacement that allows the user to also send it elsewhere. It thus doesn't seem to automatically detect the platform and use the right style for you. To get it to work on Windows you also need an extra package, alert-toast. - Builtin notifications.el relies on D-Bus. This is the best option if you don't need to support macOS or Windows.
- notify.el is unmaintained and also relies on D-Bus.