Merge branch 'add-window-title-template-parameter'

This commit is contained in:
Daniel Eklöf 2021-05-27 12:13:18 +02:00
commit 8262c1f0c2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 9 additions and 3 deletions

View file

@ -52,6 +52,7 @@
available (falling back to coloring the window margins red when available (falling back to coloring the window margins red when
unavailable) (https://codeberg.org/dnkl/foot/issues/487). unavailable) (https://codeberg.org/dnkl/foot/issues/487).
* `ctrl`+`c` as a default key binding; to cancel search/url mode. * `ctrl`+`c` as a default key binding; to cancel search/url mode.
* `${window-title}` to `notify`.
### Changed ### Changed

View file

@ -221,6 +221,11 @@ in this order:
_${body}_ will be replaced with the notification's actual _title_ _${body}_ will be replaced with the notification's actual _title_
and _body_ (message content). and _body_ (message content).
_${app-id}_ is replaced with the value of the command line option
_--app-id_, and defaults to *foot*.
_${window-title}_ is replaced with the current window title.
Applications can trigger notifications in the following ways: Applications can trigger notifications in the following ways:
- OSC 777: *\\e]777;notify;<title>;<body>\\e\\\\* - OSC 777: *\\e]777;notify;<title>;<body>\\e\\\\*

View file

@ -34,9 +34,9 @@ notify_notify(const struct terminal *term, const char *title, const char *body)
size_t argc = 0; size_t argc = 0;
if (!spawn_expand_template( if (!spawn_expand_template(
&term->conf->notify, 3, &term->conf->notify, 4,
(const char *[]){"app-id", "title", "body"}, (const char *[]){"app-id", "window-title", "title", "body"},
(const char *[]){term->conf->app_id, title, body}, (const char *[]){term->conf->app_id, term->window_title, title, body},
&argc, &argv)) &argc, &argv))
{ {
return; return;