osc: kitty notifications: implement the 'close' request

Add a new config option, desktop-notifications.close, defining what to
execute to close a notification. It has a single template parameter,
${id}, that is expanded to the external notification ID foot may have
picked up from the notification helper.

notify-send does not support closing notifications, and it appears
impossible to pass an *unsigned* integer as argument to gdbus. Hence
no default value for the new 'close' option.

Example:

    printf '\e]99;i=123;this is a notification\e\\'
    printf '\e]99;i=123:p=close;\e\\'
This commit is contained in:
Daniel Eklöf 2024-07-25 19:24:28 +02:00
parent c797222930
commit c4d9f8a8ff
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 92 additions and 9 deletions

View file

@ -77,6 +77,9 @@
`notify-focus-inhibit`.
* `${icon}`, `${urgency}`,`${action-name}` and `${action-label}` added
to the `desktop-notifications.command` template.
* `desktop-notifications.close` option, defining what to execute when
an application wants to close an existing notification (via an
OSC-99 escape sequence).
[1707]: https://codeberg.org/dnkl/foot/issues/1707
[1738]: https://codeberg.org/dnkl/foot/issues/1738