diff options
Diffstat (limited to 'sys/jao-notify.el')
-rw-r--r-- | sys/jao-notify.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/jao-notify.el b/sys/jao-notify.el index f505525..fdffe5e 100644 --- a/sys/jao-notify.el +++ b/sys/jao-notify.el @@ -1,6 +1,6 @@ ;; jao-notify.el -- Interacting with notification daemon -;; Copyright (c) 2017 Jose Antonio Ortega Ruiz +;; Copyright (c) 2017, 2019 Jose Antonio Ortega Ruiz ;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org> ;; Start date: Sun Jan 08, 2017 20:24 @@ -8,10 +8,18 @@ ;;; Comentary: -;; +;; Simple notifications using notify-send ;;; Code: +(defun jao-notify (msg &optional title icon) + (let* ((title (shell-quote-argument title)) + (msg (shell-quote-argument msg)) + (args (if title (format "%s %s" msg title) msg)) + (iflag (if (and (stringp icon) (file-exists-p icon)) + (format " -i %s" icon) + ""))) + (shell-command-to-string (format "notify-send %s%s" args iflag)))) |