Hi I would like to use the built-in notifications
library in emacs with org mode (requires compiling with d-bus). I am trying to get it setup so that I can open my daily agenda view upon startup and have this trigger a series of (run-at-time ..
calls that will run ~10 before the actual deadline. Problem is, I cannot seem to extract an alist of DEALINE . TIME entries of the deadlines in my agenda.
I have tried using the built-in org-agenda-get-deadlines
but it does not seem to work as
running (org-agenda-get-deadlines)
results in a error.
I have tried "org-alert" and "alert" but they do not appear to work. Guessing some of their dependencies are depreciated or something.
How would I go about doing this?
UPDATE
HUGE thanks to @NickD for the help, here is what I have now in my setup. (Obviously could use some cleanup, but too excited atm).
(require 'appt)
(appt-activate 1)
(use-package notifications
:demand t)
(setq appt-display-format 'window)
(setq appt-disp-window-function
(lambda (nmins curtime msg)
(notifications-notify :title "RING! RING! RING!"
:body (format "You have the appointment %s in %d minutes" msg (string-to-number nmins))
:app-name "Emacs: Org"
:sound-name "alarm-clock-elapsed")
))
(use-package org-agenda
:init
(setq org-agenda-finalize-hook 'org-agenda-to-appt)
)
Obviously this requires opening your agenda at least once (and an emacs compiled with D-Bus support), but after that I get a nice
popup to appear starting within the appt-message-warning-time
minutes of my scheduled deadline. Along with a reminder every appt-display-interval
minutes within that time frame.
UPDATE 2 Just now noticing this, but you need to enter time in military time for it to work. AM/PM will show deadline in agenda but for some reason appt fails to pick it up. But this only applies if you edit the time manually. If you use the prompt then it looks like org fixes it to military time stamp.
PS
Wonder if there is a way to have the notifications to appear without initially opening the agenda if you work with an emacs compiled with systemd support? Donno whether the agenda can be opened in a daemon tho.