From 0ce8ef78f9588ffbc83dce3c67e12421c3f7d0e9 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Thu, 17 Apr 2014 21:06:47 +0900 Subject: [PATCH] Add some eye-candy to desktop notifications * lisp/COMPILE (riece-icons): Add riece-notify-icon.png. * lisp/Makefile.am (EXTRA_DIST): Ditto. * lisp/riece-desktop-notify.el (riece-desktop-notify-icon): New. (riece-desktop-notify-gnu/linux-args): Add option to display icon. (riece-desktop-notify-keyword-notify-function): Substitute the 'icon symbol with riece-desktop-notify-icon. --- lisp/COMPILE | 3 ++- lisp/Makefile.am | 2 +- lisp/riece-desktop-notify.el | 16 +++++++++++++--- lisp/riece-notify-icon.png | Bin 0 -> 559 bytes 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 lisp/riece-notify-icon.png diff --git a/lisp/COMPILE b/lisp/COMPILE index 72452dd..3f9bf3e 100644 --- a/lisp/COMPILE +++ b/lisp/COMPILE @@ -62,7 +62,8 @@ "riece-command-configure-windows.xpm" "riece-command-list-addons.xpm" "riece-command-join.xpm" - "riece-command-part.xpm")) + "riece-command-part.xpm" + "riece-notify-icon.png")) (defvar riece-scripts '("server.rb" diff --git a/lisp/Makefile.am b/lisp/Makefile.am index df9eeec..b8e4099 100644 --- a/lisp/Makefile.am +++ b/lisp/Makefile.am @@ -24,7 +24,7 @@ EXTRA_DIST = COMPILE \ url-riece.el \ riece-command-previous-channel.xpm riece-command-next-channel.xpm \ riece-command-configure-windows.xpm riece-command-list-addons.xpm \ - riece-command-join.xpm riece-command-part.xpm \ + riece-command-join.xpm riece-command-part.xpm riece-notify-icon.png \ server.rb aproxy.rb CLEANFILES = auto-autoloads.el custom-load.el *.elc lunit-report.xml diff --git a/lisp/riece-desktop-notify.el b/lisp/riece-desktop-notify.el index a696cae..6cd5e8b 100644 --- a/lisp/riece-desktop-notify.el +++ b/lisp/riece-desktop-notify.el @@ -79,6 +79,12 @@ This function must have only one message object as argument." :type 'coding-system :group 'riece-desktop-notify) +(defcustom riece-desktop-notify-icon + (expand-file-name "riece-notify-icon.png" riece-data-directory) + "*Icon to display in desktop notifications." + :type '(file :must-match t) + :group 'riece-desktop-notify) + (defcustom riece-desktop-notify-type (if (eq system-type 'linux) 'gnu/linux system-type) "*The type to notify desktop." @@ -108,11 +114,13 @@ This function must have only one message object as argument." :type 'file :group 'riece-desktop-notify) -(defcustom riece-desktop-notify-gnu/linux-args '("-u" "low" title message) +(defcustom riece-desktop-notify-gnu/linux-args + '("-i" icon "-u" "low" title message) "*The Arguments to notify for GNU/Linux." :type '(repeat (radio (string :tag "Argument") (const :tag "Title" title) - (const :tag "Message" message))) + (const :tag "Message" message) + (const :tag "Icon" icon))) :group 'riece-desktop-notify) ;; for Windows @@ -176,7 +184,9 @@ This function must have only one message object as argument." (cons 'message (encode-coding-string message - riece-desktop-notify-coding-system))))) + riece-desktop-notify-coding-system)) + (cons 'icon + riece-desktop-notify-icon)))) (file-error nil)))))))) (setq riece-desktop-notify-last-message message)) diff --git a/lisp/riece-notify-icon.png b/lisp/riece-notify-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..78a28c85312d51c833770aca3e66a19ccbcd9cd4 GIT binary patch literal 559 zcmWlXYfBRV07dT%ZCh$8%d}JqoEfvF3|ggS$>uiQ*0iZ*<)b3eks3zkXrzlC`w%_E z40@nZp-A(CwgNN7R`ftxC=zH9W+{bInP_UetqbRzKX4r;qb5kaN(>-Kr&VS9n)n~# z5}%7kL=Sy=Z_=C9RDud{BPa!Rm%L`f!BA@JG{+y*XGyF5-H$R{eI@;_?}ZlO%ADGcQ=(gIglRMHhUz}++iolK z3m%WjOU>44d#_5;F`GVU`}ssXA$}%5cj&?^y*Auf(dd!|-ieQBFS{7!n(evV;AtA{ z9PG?2ot8A6Ft#q-NbpYizui#tW4QhFy8EH8