Add some eye-candy to desktop notifications
authorSteve Youngs <steve@sxemacs.org>
Thu, 17 Apr 2014 12:06:47 +0000 (21:06 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 23 Apr 2014 06:40:48 +0000 (15:40 +0900)
* 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
lisp/Makefile.am
lisp/riece-desktop-notify.el
lisp/riece-notify-icon.png [new file with mode: 0644]

index 72452dd..3f9bf3e 100644 (file)
@@ -62,7 +62,8 @@
     "riece-command-configure-windows.xpm"
     "riece-command-list-addons.xpm"
     "riece-command-join.xpm"
     "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"
 
 (defvar riece-scripts
   '("server.rb"
index df9eeec..b8e4099 100644 (file)
@@ -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 \
        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
        server.rb aproxy.rb
 
 CLEANFILES = auto-autoloads.el custom-load.el *.elc lunit-report.xml
index a696cae..6cd5e8b 100644 (file)
@@ -79,6 +79,12 @@ This function must have only one message object as argument."
   :type 'coding-system
   :group 'riece-desktop-notify)
 
   :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."
 (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)
 
   :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)
   "*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
   :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
                                (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))
 
                (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 (file)
index 0000000..78a28c8
Binary files /dev/null and b/lisp/riece-notify-icon.png differ