From b0bf8ca5f7034f6d95bc3b58082e719a81d99859 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 19 Jul 2024 15:04:28 +0200 Subject: osc/notify: add support for OSC-99, kitty desktop notifications This adds limited support for OSC-99, kitty desktop notifications[^1]. We support everything defined by the "protocol", except: * 'a': action to perform on notification activation. Since we don't trigger the notification ourselves (over D-Bus), we don't know a) which ID the notification got, or b) when it is clicked. * ... and that's it. Everything else is supported To be explicit, we *do* support: * Chunked notifications (d=0|1), allowing the application to append data to a notification in chunks, before it's finally displayed. * Plain UTF-8, or base64-encoded UTF-8 payload (e=0|1). * Notification identifier (i=xyz). * Payload type (p=title|body). * When to honor the notification (o=always|unfocused|invisible), with the following quirks: - we don't know when the window is invisible, thus it's treated as 'unfocused'. - the foot option 'notify-focus-inhibit' overrides 'always' * Urgency (u=0|1|2) [^1]: https://sw.kovidgoyal.net/kitty/desktop-notifications/ --- terminal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 44a101eb..65dde151 100644 --- a/terminal.h +++ b/terminal.h @@ -20,6 +20,7 @@ #include "fdm.h" #include "key-binding.h" #include "macros.h" +#include "notify.h" #include "reaper.h" #include "shm.h" #include "wayland.h" @@ -798,6 +799,8 @@ struct terminal { void *cb_data; } shutdown; + tll(struct kitty_notification) kitty_notifications; + char *foot_exe; char *cwd; -- cgit v1.3