From f9a13e2eec2c98c8853073607347f65f4291a7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 27 May 2021 11:41:57 +0200 Subject: [PATCH] config: notify: change default value to use ${app-id} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the default value of ‘notify’ use ${app-id} for icon and application name. --- CHANGELOG.md | 2 ++ config.c | 2 +- doc/foot.ini.5.scd | 2 +- foot.ini | 2 +- notify.c | 6 +++--- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f15f47d4..539e2f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,8 @@ * `ctrl + w` (_extend-to-word-boundary_) can now be used across lines (https://codeberg.org/dnkl/foot/issues/421). * Ignore auto-detected URLs that overlap with OSC-8 URLs. +* Default value for the `notify` option to use `-a ${app-id} -i + ${app-id} ...` instead of `-a foot -i foot ...`. ### Deprecated diff --git a/config.c b/config.c index c28cfcb8..65ae7ffa 100644 --- a/config.c +++ b/config.c @@ -2574,7 +2574,7 @@ config_load(struct config *conf, const char *conf_path, } conf->notify.raw_cmd = xstrdup( - "notify-send -a foot -i foot ${title} ${body}"); + "notify-send -a ${app-id} -i ${app-id} ${title} ${body}"); tokenize_cmdline(conf->notify.raw_cmd, &conf->notify.argv); conf->url.launch.raw_cmd = xstrdup("xdg-open ${url}"); diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 50ddb787..534f3e58 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -228,7 +228,7 @@ in this order: Notifications are *inhibited* if the foot window has keyboard focus. - Default: _notify-send -a foot -i foot ${title} ${body}_. + Default: _notify-send -a ${app-id} -i ${app-id} ${title} ${body}_. *selection-target* Clipboard target to automatically copy selected text to. One of diff --git a/foot.ini b/foot.ini index e190933f..43a0306c 100644 --- a/foot.ini +++ b/foot.ini @@ -21,7 +21,7 @@ # pad=2x2 # optionally append 'center' # resize-delay-ms=100 -# notify=notify-send -a foot -i foot ${title} ${body} +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} # bold-text-in-bright=no # bell=none diff --git a/notify.c b/notify.c index 3f36e904..c51dcf68 100644 --- a/notify.c +++ b/notify.c @@ -34,9 +34,9 @@ notify_notify(const struct terminal *term, const char *title, const char *body) size_t argc = 0; if (!spawn_expand_template( - &term->conf->notify, 2, - (const char *[]){"title", "body"}, - (const char *[]){title, body}, + &term->conf->notify, 3, + (const char *[]){"app-id", "title", "body"}, + (const char *[]){term->conf->app_id, title, body}, &argc, &argv)) { return;