alphapapa / hammy.el

Programmable, interactive interval timers (e.g. for working/resting)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `notify` on macOS with the `alert` package

gsingh93 opened this issue · comments

As far as I know the notifications package doesn't support macOS. alert is an alternative that does work on macOS and other platforms. Would you accept a PR that allows customizing whether notifications or alert is used depending on some configuration option (i.e. (setq hammy-use-alert t), feel free to suggest a better name)?

This isn't really preventing me from using the package, as I can just use some other lisp code to work around this, but it would be nice to use the built-in notify pseudo-function.

I don't think we would need to add alert as a dependency, as this option would be off by default, but open to your thoughts about this.

Hi,

Generally I'd prefer not to add options for integrations with specific other packages. In this case, if notifications-notify is truly useless for a Mac user, it would seem appropriate for that user to do something like:

(define-advice notifications-notify
    (:override (&rest params) using-alert)
  (alert (plist-get params :body)
         :title (plist-get params :title)))

That would solve the problem for any library that calls notifications-notify, wouldn't it? If so, it might be appropriate to propose an addition to alert that would implement advice like that as a minor mode that Mac users could activate.

What do you think? Thanks.

This makes sense to me, I'll open an issue on the alert repo. Thanks!