summaryrefslogtreecommitdiff
path: root/todo.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-06-26 16:52:22 -0500
committerCraig Jennings <c@cjennings.net>2025-06-26 16:52:22 -0500
commitf6aef4673ee17af2a66f155253518a9d0f27f9ae (patch)
tree96214f69415940f5d9c7a46c8422f9e44a537a89 /todo.org
parent4ee39141c546af1607445fd88d617ee6cef8c4e3 (diff)
downloaddotemacs-f6aef4673ee17af2a66f155253518a9d0f27f9ae.tar.gz
dotemacs-f6aef4673ee17af2a66f155253518a9d0f27f9ae.zip
Thursday, June 26, 2025 at 04:52:27 PM CDT
Diffstat (limited to 'todo.org')
-rw-r--r--todo.org63
1 files changed, 63 insertions, 0 deletions
diff --git a/todo.org b/todo.org
index bd9e2ae6..889eac43 100644
--- a/todo.org
+++ b/todo.org
@@ -85,6 +85,69 @@ Captured On: [2025-05-29 Thu 04:24]
[[https://jao.io/blog/signel.html][signel, a barebones signal chat on top of signal-cli]]
Captured On: [2025-05-29 Thu 04:23]
+** TODO Test This Method for Alarms In Emacs
+#+BEGIN_QUOTE
+
+
+I am quite happy with the system I use, which does (I think) exactly what you want. It has two parts: an Emacs part that uses appt.el to schedule the reminders and a small shell program (I'm using Linux) that creates the popup + sound notification. Here I share the code for both parts.
+
+A) Code in ~/.emacs.d/init.el
+
+(require 'appt)
+(appt-activate t)
+
+(setq appt-message-warning-time 5) ; Show notification 5 minutes before event
+(setq appt-display-interval appt-message-warning-time) ; Disable multiple reminders
+(setq appt-display-mode-line nil)
+
+; Use appointment data from org-mode
+(defun my-org-agenda-to-appt ()
+ (interactive)
+ (setq appt-time-msg-list nil)
+ (org-agenda-to-appt))
+
+; Update alarms when...
+; (1) ... Starting Emacs
+(my-org-agenda-to-appt)
+
+; (2) ... Everyday at 12:05am (useful in case you keep Emacs always on)
+(run-at-time "12:05am" (* 24 3600) 'my-org-agenda-to-appt)
+
+; (3) ... When TODO.txt is saved
+(add-hook 'after-save-hook
+ '(lambda ()
+ (if (string= (buffer-file-name) (concat (getenv "HOME") "/ideas/TODO.txt"))
+ (my-org-agenda-to-appt))))
+
+; Display appointments as a window manager notification
+(setq appt-disp-window-function 'my-appt-display)
+(setq appt-delete-window-function (lambda () t))
+
+(setq my-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification"))
+
+(defun my-appt-display (min-to-app new-time msg)
+ (if (atom min-to-app)
+ (start-process "my-appt-notification-app" nil my-appt-notification-app min-to-app msg)
+ (dolist (i (number-sequence 0 (1- (length min-to-app))))
+ (start-process "my-appt-notification-app" nil my-appt-notification-app (nth i min-to-app) (nth i msg)))))
+
+B) Code in ~/bin/appt-notification
+
+#!/bin/sh
+
+TIME="$1"
+MSG="$2"
+
+notify-send -t 0 "<br>Appointment in $TIME minutes:<br>$MSG<br>"
+play "~/bin/alarm.wav"
+
+To get voice notifications you could replace the last line (play) with the following:
+
+espeak "Appointment in $TIME minutes: $MSG"
+#+END_QUOTE
+[[https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events][Good methods for setting up alarms (audio + visual) triggered by org-mode events? - Emacs Stack Exchange]]
+Captured On: [2025-06-19 Thu 12:29]
+** TODO [#C] Emacs: Should adding tasks add it to Projects and Tasks in the inbox file?
* Emacs Project Ideas/References
** emacs-tw/awesome-elisp: 🏵️ A curated list of Emacs Lisp development resources
[[https://github.com/emacs-tw/awesome-elisp][emacs-tw/awesome-elisp: 🏵️ A curated list of Emacs Lisp development resources]]