Skip to content

Org-alert for windows 10 style notifications #31

Description

@Horrih

Hello,
Thank you for your amazing package !
At work I have to use windows 10, and I was sorely missing desktop notifications for my events/tasks.
alert, which org-alert uses under the hood, has no such default style available to my knowledge.

I'm probably not representative of your community of users, but would you consider adding a windows example in your README ?
To keep it concise, it could be a simple link to this issue. It could have saved me quite a bit of time figuring it out !

Here is what I ended up doing in my init.el

(use-package alert
  :config
  ;; Add the windows desktop notifications if on windows
  (when (eq system-type 'windows-nt)
    (alert-define-style
     'windows-desktop-notification-style
     :title "Windows Desktop Notification style"
     :notifier
     (lambda (info)
       (let ((notif-id (w32-notification-notify :title (plist-get info :title) :body (plist-get info :message))))
         ;; Close it after 3 seconds (no new notification can be sent if left unclosed)
         (run-with-timer 3 nil `(lambda() (w32-notification-close ,notif-id))))))
    (setq alert-default-style 'windows-desktop-notification-style)))

(use-package org-alert
  :demand  ; Load it on startup, not lazily
  :config
  (org-alert-enable))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions