summaryrefslogtreecommitdiffhomepage
path: root/sys/jao-notify.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2019-11-15 20:50:03 +0000
committerjao <jao@gnu.org>2019-11-15 20:50:03 +0000
commit7a2a9424818002f2b64221f533aeae18278604d3 (patch)
treefdae94a1bb7decd38cb306589251b54f4e74c106 /sys/jao-notify.el
parent6a2db0f9c0c4620f0d7f8c6926f4794d36df76f8 (diff)
downloadelibs-7a2a9424818002f2b64221f533aeae18278604d3.tar.gz
elibs-7a2a9424818002f2b64221f533aeae18278604d3.tar.bz2
jao-notify in jao-notify
Diffstat (limited to 'sys/jao-notify.el')
-rw-r--r--sys/jao-notify.el12
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))))