Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (setq diary-file "~/Dropbox/org/diary.org")
- (add-hook 'after-save-hook
- '(lambda ()
- (if (string-match-p (regexp-quote "~/Dropbox/org/brain") (buffer-file-name))
- (org-agenda-to-appt))))
- (defun talky-popup (title msg &optional icon sound)
- "Show a popup if we're on X, or echo it otherwise; TITLE is the title
- of the message, MSG is the context. Optionally, you can provide an ICON and
- a sound to be played"
- (interactive)
- ;;verbal warning
- (shell-command
- ;; (concat "espeak -v mb-en1 -k5 -s125 " "'" title " " msg "'" " --stdout | paplay") ;; use local espeak
- (concat "echo " "'" title "'" " " "'" msg "'" " |text-to-speech en-gb") ;; use remote Google voices
- ;; text-to-speech is from https://github.com/taylorchu/speech-to-text-text-to-speech
- )
- (if (eq window-system 'x)
- (shell-command (concat "notify-send -u critical -t 1800000 "
- (if icon (concat "-i " icon) "")
- " '" title "' '" msg "'"))
- ;; text only version
- (message (concat title ": " msg))))
- ;; the appointment notification facility
- (setq
- appt-message-warning-time 15 ;; warn 15 min in advance
- appt-display-mode-line t ;; show in the modeline
- appt-display-format 'window) ;; use our func
- (appt-activate 1) ;; active appt (appointment notification)
- (display-time) ;; time display is required for this...
- ;; our little façade-function for talky-popup
- (defun talky-appt-display (min-to-app new-time msg)
- (talky-popup (format "In %s minutes:" min-to-app) msg
- ;; "/usr/share/icons/gnome/32x32/status/appointment-soon.png" ;; optional icon
- ;; "/usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg" ;; optional sound
- ))
- (setq appt-disp-window-function (function talky-appt-display))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement