Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; Terminal notifier
  3. ;; requires 'sudo gem install terminal-notifier'
  4. ;; stolen from erc-notifier
  5.  
  6. (defvar terminal-notifier-command (executable-find "terminal-notifier") "The path to terminal-notifier.")
  7.  
  8. ; (terminal-notifier-notify "Emacs notification" "Something amusing happened")
  9.  
  10. (defun terminal-notifier-notify (title message)
  11. "Show a message with `terminal-notifier-command`."
  12. (start-process "terminal-notifier"
  13. "*terminal-notifier*"
  14. terminal-notifier-command
  15. "-title" title
  16. "-message" message
  17. "-activate" "org.gnu.Emacs"))
  18.  
  19. (defun timed-notification(time msg)
  20. (interactive "sNotification when (e.g: 2 minutes, 60 seconds, 3 days): \nsMessage: ")
  21. (run-at-time time nil (lambda (msg) (terminal-notifier-notify "Emacs" msg)) msg))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement