aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-27 10:11:47 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-27 10:11:47 +0000
commitf1d75a1e1f3c5798fa97c0c858b4c5f5dd23514d (patch)
treed9c538b6839a707347344b58b705e8a170a5f130
parentMerge branch 'app-id-in-notify' (diff)
notify: add ${window-title}
-rw-r--r--CHANGELOG.md1
-rw-r--r--doc/foot.ini.5.scd5
-rw-r--r--notify.c6
3 files changed, 9 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 539e2f25..b18227be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,7 @@
available (falling back to coloring the window margins red when
unavailable) (https://codeberg.org/dnkl/foot/issues/487).
* `ctrl`+`c` as a default key binding; to cancel search/url mode.
+* `${window-title}` to `notify`.
### Changed
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 534f3e58..33e794aa 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -221,6 +221,11 @@ in this order:
_${body}_ will be replaced with the notification's actual _title_
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:
- OSC 777: *\\e]777;notify;<title>;<body>\\e\\\\*
diff --git a/notify.c b/notify.c
index c51dcf68..e4f0ad14 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, 3,
- (const char *[]){"app-id", "title", "body"},
- (const char *[]){term->conf->app_id, title, body},
+ &term->conf->notify, 4,
+ (const char *[]){"app-id", "window-title", "title", "body"},
+ (const char *[]){term->conf->app_id, term->window_title, title, body},
&argc, &argv))
{
return;