From c4d9f8a8ff4d65b43defb8d63e775e8b91f82bed Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 25 Jul 2024 19:24:28 +0200 Subject: 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\\' --- doc/foot.ini.5.scd | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 72e6d052..195baafe 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -513,6 +513,18 @@ xdgtoken=95ebdfe56e4f47ddb5bba9d7dc3a2c35 Default: _notify-send --wait --app-name ${app-id} --icon ${icon} --urgency ${urgency} --action ${action-name}=${action-label} --print-id -- ${title} ${body}_. +*close* + Command to execute to close an existing notification. + + _${id}_ is expanded to the ID of the notification that should be + closed. For example: + + fyi --close ${id} + + Closing a notification is only supported by the Kitty Desktop + Notification protocol, OSC-99. + + Default: _not set_ *inhibit-when-focused* Boolean. If enabled, foot will not display notifications if the -- cgit v1.3