From 7a2a9424818002f2b64221f533aeae18278604d3 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 15 Nov 2019 20:50:03 +0000 Subject: jao-notify in jao-notify --- sys/jao-notify.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/jao-notify.el') 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 ;; 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)))) -- cgit v1.2.3