aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-09-13 06:39:36 +0200
committerMichael Albinus2010-09-13 06:39:36 +0200
commit7ea2d3835ed57c781f46b734f8c70605b2681aba (patch)
tree89081aa2cd05b3d824db0b735898ea65e1f75a80
parent21fa8e37fd4df7d0f23ddbc7ec99c63578b23617 (diff)
downloademacs-7ea2d3835ed57c781f46b734f8c70605b2681aba.tar.gz
emacs-7ea2d3835ed57c781f46b734f8c70605b2681aba.zip
* notifications.el (notifications-notify): Add support for
image-path and sound-name. (notifications-specification-version): Add this variable.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/notifications.el20
2 files changed, 26 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 081d9a53735..dec338e36d6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12010-09-13 Julien Danjou <julien@danjou.info>
2
3 * notifications.el (notifications-notify): Add support for
4 image-path and sound-name.
5 (notifications-specification-version): Add this variable.
6
12010-09-12 Stefan Monnier <monnier@iro.umontreal.ca> 72010-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * subr.el (y-or-n-p): New function, moved from src/fns.c. Use read-key. 9 * subr.el (y-or-n-p): New function, moved from src/fns.c. Use read-key.
diff --git a/lisp/notifications.el b/lisp/notifications.el
index beb63a6311b..68db58e54fa 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -42,6 +42,9 @@
42 42
43(require 'dbus) 43(require 'dbus)
44 44
45(defconst notifications-specification-version "1.1"
46 "The version of the Desktop Notifications Specification implemented.")
47
45(defconst notifications-application-name "Emacs" 48(defconst notifications-application-name "Emacs"
46 "Default application name.") 49 "Default application name.")
47 50
@@ -151,7 +154,14 @@ Various PARAMS can be set:
151 :image-data This is a raw data image format which describes the width, 154 :image-data This is a raw data image format which describes the width,
152 height, rowstride, has alpha, bits per sample, channels and 155 height, rowstride, has alpha, bits per sample, channels and
153 image data respectively. 156 image data respectively.
157 :image-path This is represented either as a URI (file:// is the
158 only URI schema supported right now) or a name
159 in a freedesktop.org-compliant icon theme.
154 :sound-file The path to a sound file to play when the notification pops up. 160 :sound-file The path to a sound file to play when the notification pops up.
161 :sound-name A themeable named sound from the freedesktop.org sound naming
162 specification to play when the notification pops up.
163 Similar to icon-name,only for sounds. An example would
164 be \"message-new-instant\".
155 :suppress-sound Causes the server to suppress playing any sounds, if it has 165 :suppress-sound Causes the server to suppress playing any sounds, if it has
156 that ability. 166 that ability.
157 :x Specifies the X location on the screen that the notification 167 :x Specifies the X location on the screen that the notification
@@ -186,7 +196,9 @@ used to manipulate the notification item with
186 (category (plist-get params :category)) 196 (category (plist-get params :category))
187 (desktop-entry (plist-get params :desktop-entry)) 197 (desktop-entry (plist-get params :desktop-entry))
188 (image-data (plist-get params :image-data)) 198 (image-data (plist-get params :image-data))
199 (image-path (plist-get params :image-path))
189 (sound-file (plist-get params :sound-file)) 200 (sound-file (plist-get params :sound-file))
201 (sound-name (plist-get params :sound-name))
190 (suppress-sound (plist-get params :suppress-sound)) 202 (suppress-sound (plist-get params :suppress-sound))
191 (x (plist-get params :x)) 203 (x (plist-get params :x))
192 (y (plist-get params :y)) 204 (y (plist-get params :y))
@@ -211,10 +223,18 @@ used to manipulate the notification item with
211 (add-to-list 'hints `(:dict-entry 223 (add-to-list 'hints `(:dict-entry
212 "image_data" 224 "image_data"
213 (:variant :struct ,image-data)) t)) 225 (:variant :struct ,image-data)) t))
226 (when image-path
227 (add-to-list 'hints `(:dict-entry
228 "image_path"
229 (:variant :string ,image-path)) t))
214 (when sound-file 230 (when sound-file
215 (add-to-list 'hints `(:dict-entry 231 (add-to-list 'hints `(:dict-entry
216 "sound-file" 232 "sound-file"
217 (:variant :string ,sound-file)) t)) 233 (:variant :string ,sound-file)) t))
234 (when sound-name
235 (add-to-list 'hints `(:dict-entry
236 "sound-name"
237 (:variant :string ,sound-name)) t))
218 (when suppress-sound 238 (when suppress-sound
219 (add-to-list 'hints `(:dict-entry 239 (add-to-list 'hints `(:dict-entry
220 "suppress-sound" 240 "suppress-sound"