emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adonay Felipe Nogueira <adfeno@openmailbox.org>
To: emacs-orgmode@gnu.org
Subject: Agenda notifications for timeless entries, and variable by priority
Date: Tue, 28 Mar 2017 11:30:32 -0300	[thread overview]
Message-ID: <87efxhh3sn.fsf@openmailbox.org> (raw)

I'm currently using the following in my .emacs file to have
notifications for Org agenda events:

# Begin of file part
(setq appt-delete-window-function (lambda () t))

(require 'notifications)
(defun adfeno-appt-disp-window-function (min-remaining future-time diary-entry)
  (when (atom min-remaining)
    (notifications-notify
     :title diary-entry
     :body min-remaining
     :category "presence"
     :urgency "normal")
    (if (string-match-p "[[:space:]]\\[#A\\][[:space:]]" diary-entry)
	(start-process "adfeno-appt-notification-important" nil
		       "paplay"
		       "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga")
      (start-process "adfeno-appt-notification-normal" nil
		     "timeout" "1"
		     "paplay"
		     "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"))))
(setq appt-disp-window-function 'adfeno-appt-disp-window-function)

(defun adfeno-org-agenda-to-appt ()
  (interactive)
  (setq appt-time-msg-list nil)
    (org-agenda-to-appt))

(run-at-time "00:01" (* 24 (* 60 60)) 'adfeno-org-agenda-to-appt)

;; Ativa as notificações de atividades marcadas.
(require 'appt)
(appt-activate 1)
(adfeno-org-agenda-to-appt)
# End of file part

However, if my agenda entries have no time, but of course have a date,
the notifications, noticeably for #A-priprity entries, don't evidence a
longer sound alarm. And might not even be displaying a pop-up for these
#A-priority events, because I never see such pop-ups when starting Emacs
for the first time in a day.

So my questions are: Do you know a way to have notifications that:

- Vary depending on the priority of the entry.
- Accept timeless entries (no hour, minute, or second).
- Make sound notifications, also varying by priority.

... ?


Respectfully, Adonay.
-- 
- [[https://libreplanet.org/wiki/User:Adfeno]]
- Palestrante e consultor sobre /software/ livre (não confundir com
  gratis).
- "WhatsApp"? Ele não é livre, por isso não uso. Iguais a ele prefiro
  Ring, ou Tox. Quer outras formas de contato? Adicione o vCard que
  está no endereço acima aos teus contatos.
- Pretende me enviar arquivos .doc, .ppt, .cdr, ou .mp3? OK, eu
  aceito, mas não repasso. Entrego apenas em formatos favoráveis ao
  /software/ livre. Favor entrar em contato em caso de dúvida.
- "People said I should accept the world. Bullshit! I don't accept the
  world."
                                                 --- Richard Stallman

                 reply	other threads:[~2017-03-28 14:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efxhh3sn.fsf@openmailbox.org \
    --to=adfeno@openmailbox.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).