From 42a911c61e67caa807750cd40887b729f09aaf52 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 27 Jul 2023 16:43:17 +0200 Subject: notifications: Allow to use Icon Naming Specification for app-icon * doc/lispref/os.texi (Desktop Notifications): Extend meaning of :app-icon. * etc/NEWS: Allow to use Icon Naming Specification for app-icon in notifications-notify. * lisp/notifications.el (notifications-notify): Allow to use Icon Naming Specification for app-icon. --- lisp/notifications.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/notifications.el b/lisp/notifications.el index 984ddbec5e9..a694b38e52e 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el @@ -137,6 +137,12 @@ Various PARAMS can be set: :app-icon The notification icon. Default is `notifications-application-icon'. Set to nil if you do not want any icon displayed. + If the value is a string, the function + interprets it as a file name and converts to + absolute by using `expand-file-name'; if it is a + symbol, the function will use its name (which is + useful when using the Icon Naming + Specification). :actions A list of actions in the form: (KEY TITLE KEY TITLE ...) where KEY and TITLE are both strings. @@ -304,7 +310,10 @@ of another `notifications-notify' call." notifications-application-name) :uint32 (or replaces-id 0) :string (if app-icon - (expand-file-name app-icon) + (if (stringp app-icon) + (expand-file-name app-icon) + ;; Convert symbol to string + (symbol-name app-icon)) ;; If app-icon is nil because user ;; requested it to be so, send the ;; empty string -- cgit v1.2.1