Skip to content

OSC-99 desktop notifications: closing notifications from the app #7659

@delthas

Description

@delthas

Use case

It would be useful for me as a terminal IRC client developer, to be able to manually close some notifications (by identifier, not all at once) from my app. Consider the following use case:

  • User is mentioned on channel #A (while away)
  • User reads the notification from another device (e.g. his phone)
  • My app clears the notifications for channel #A manually, so that when the user comes back to his desktop there is no mention of the notification that was read

Another scenario could be that the user focuses the channel in my app, so I should mark it as read and clear the notification.

I need it to be per-notification, because the user can be mentioned on several channels, and I would only clear the one channel that the user has read/switched to.

Proposal

Add a way for an app to dismiss a notification, by identifier, to the OSC 99 specification.

I don't need to know if the notification was really dismissed, it's best-effort, so I don't really need a response to that command. (But am OK with such a response being added.)

For example, this could be added with a new metadata parameter:

  • c, 0 or 1, defaults to 0, Indicates if the notification should be closed.

c only makes sense when i is specified, and a notification was already opened previously with that identifier.

Example:

  • Send a notification: printf '\x1b]99;i=1:d=1:p=body;This is cool\x1b\\'
  • Close it manually: printf '\x1b]99;i=1:d=1:c=1;\x1b\\'

cc @dnkl

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions