mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
notify: ${icon}: don't fallback to app-id
* Revert --icon to ${app-id}
* Use --hint STRING:image-path:${icon} instead
* ${icon} no longer expands to ${app-id} if notification has no icon
This commit is contained in:
parent
0a5ba708e4
commit
ba79bf1602
4 changed files with 5 additions and 8 deletions
2
config.c
2
config.c
|
|
@ -3231,7 +3231,7 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
parse_modifiers(XKB_MOD_NAME_SHIFT, 5, &conf->mouse.selection_override_modifiers);
|
parse_modifiers(XKB_MOD_NAME_SHIFT, 5, &conf->mouse.selection_override_modifiers);
|
||||||
|
|
||||||
tokenize_cmdline(
|
tokenize_cmdline(
|
||||||
"notify-send --wait --app-name ${app-id} --icon ${icon} --urgency ${urgency} --action ${action-name}=${action-label} --print-id -- ${title} ${body}",
|
"notify-send --wait --app-name ${app-id} --icon ${app-id} --urgency ${urgency} --hint STRING:image-path:${icon} --action ${action-name}=${action-label} --print-id -- ${title} ${body}",
|
||||||
&conf->desktop_notifications.command.argv.args);
|
&conf->desktop_notifications.command.argv.args);
|
||||||
tokenize_cmdline("xdg-open ${url}", &conf->url.launch.argv.args);
|
tokenize_cmdline("xdg-open ${url}", &conf->url.launch.argv.args);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -511,7 +511,7 @@ Note: do not set *TERM* here; use the *term* option in the main
|
||||||
action=default++
|
action=default++
|
||||||
xdgtoken=95ebdfe56e4f47ddb5bba9d7dc3a2c35
|
xdgtoken=95ebdfe56e4f47ddb5bba9d7dc3a2c35
|
||||||
|
|
||||||
Default: _notify-send --wait --app-name ${app-id} --icon ${icon} --urgency ${urgency} --action ${action-name}=${action-label} --print-id -- ${title} ${body}_.
|
Default: _notify-send --wait --app-name ${app-id} --icon ${app-id} --urgency ${urgency} --hint STRING:image-path:${icon} --action ${action-name}=${action-label} --print-id -- ${title} ${body}_.
|
||||||
|
|
||||||
*close*
|
*close*
|
||||||
Command to execute to close an existing notification.
|
Command to execute to close an existing notification.
|
||||||
|
|
|
||||||
2
foot.ini
2
foot.ini
|
|
@ -47,7 +47,7 @@
|
||||||
# command-focused=no
|
# command-focused=no
|
||||||
|
|
||||||
[desktop-notifications]
|
[desktop-notifications]
|
||||||
# command=notify-send --wait --app-name ${app-id} --icon ${icon} --urgency ${urgency} --action ${action-name}=${action-label} --print-id -- ${title} ${body}
|
# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --urgency ${urgency} --hint STRING:image-path:${icon} --action ${action-name}=${action-label} --print-id -- ${title} ${body}
|
||||||
# close=""
|
# close=""
|
||||||
# inhibit-when-focused=yes
|
# inhibit-when-focused=yes
|
||||||
|
|
||||||
|
|
|
||||||
7
notify.c
7
notify.c
|
|
@ -223,11 +223,8 @@ notify_notify(struct terminal *term, struct notification *notif)
|
||||||
const char *title = notif->title != NULL ? notif->title : notif->body;
|
const char *title = notif->title != NULL ? notif->title : notif->body;
|
||||||
const char *body = notif->title != NULL && notif->body != NULL ? notif->body : "";
|
const char *body = notif->title != NULL && notif->body != NULL ? notif->body : "";
|
||||||
|
|
||||||
/* Icon: use symbolic name from notification, if present,
|
/* Icon: symbolic name if present, otherwise a filename */
|
||||||
otherwise fallback to the application ID */
|
const char *icon_name_or_path = "";
|
||||||
const char *icon_name_or_path = term->app_id != NULL
|
|
||||||
? term->app_id
|
|
||||||
: term->conf->app_id;
|
|
||||||
|
|
||||||
if (notif->icon_id != NULL) {
|
if (notif->icon_id != NULL) {
|
||||||
for (size_t i = 0; i < ALEN(term->notification_icons); i++) {
|
for (size_t i = 0; i < ALEN(term->notification_icons); i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue