Documented issue with special characters in URL.
Build readme file for sourcehut through build automation
Added features to set header and tag, improved documentation.
This is a small package to provide an interface to use the https://ntfy.sh service (or self-hosted version) to send notification from Emacs. The initial use case is to send quick notifications from emacs to a mobile device (ntfy only support Android currently) as reminders. The ntfy-send-message
can also be utilized to send notifications from other functions.
The ntfy.el
file can be downloaded and loaded via load-file
and other installation means.
Recommended: the package can be installed and configured using straight.el
using:
(use-package ntfy
:straight (ntfy :type git :host nil :repo "https://git.sr.ht/~shom/ntfy")
:config (setq ntfy-server "https://ntfy.sh"
ntfy-topic "mytopic"
ntfy-header "Notification from emacs"
ntfy-tags "purple_circle,loudspeaker"))
The following custom variables must be configured:
nfty-server
: The URL of the server (including the https://
part), ntfy.sh generously offers a free hosted version so it can be set to https://ntfy.sh
, be please be mindful of how we use this free resource and review the privacy policy of the service.nfty-topic
: The topic or channel where the notification should be published. If using the public ntfy.sh service, ensure that is not an easily guessable topic.ntfy-header
: This is the title of the notification, the message is sent as the body of the notification.ntfy-tags
: The emoji(s) that'll appear before the header message. Use comma separated (no spaces) string, see https://ntfy.sh/docs/publish/#tags-emojis for details.Once the package is loaded and configured a notification can be sent by invoking the following commands interactively or programmatically:
Interactive | Programmatic |
---|---|
ntfy-send-message |
(ntfy-send-message MESSAGE) |
ntfy-send-message-with-header |
(ntfy-send-message-with-header HEADER MESSAGE) |
ntfy-send-message-with-header-and-tags |
(ntfy-send-message-with-header-and-tags TAGS HEADER MESSAGE) |
ntfy-send-url |
(ntfy-send-url URL) |
This is the first Emacs package I've put together, contributions, suggestions for best practices, and constructive criticism is very much welcome and appreciated.
Here are some of the potential improvements:
Emacs 27.2
& 28.0.92
using curl
on Pop!OS (20.04 and 22.04) and Termux.