ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.41k stars 63 forks source link

[Feature] Get list of notifications & clear/dismiss specific notifications #468

Open NovaAndrom3da opened 3 months ago

NovaAndrom3da commented 3 months ago

Is your feature request related to a problem? Please describe. It would be useful to be able to access information and interact with current notifications from the command line/a third-party program, as well as assigning notifications unique IDs that could be dismissed manually.

Describe the solution you'd like A command could be added that would return JSON output, perhaps something similar to this:

user@machine:~ $ swaync-client --get-notifications
[
    {
        "id": 0,
        "title": "Test notification",
        "body": "this notification is an example",
        "icon": "firefox",
        "urgency": 0,
        "visible": false,
        "inhibited": false,
        "actions": [
            "send another notification": "notify-send 'test!'"
        ]
    },
    {
        "id": 1,
        "title": "test!",
        "body": null,
        "icon": null,
        "urgency": 0,
        "visible": true,
        "inhibited": false,
        "actions": []
    }
]
user@machine:~ $ swaync-client --close 0  # This would dismiss the "Test notification"
user@machine:~ $

Describe alternatives you've considered It could also be output as a human readable format, but I like this idea as it makes it easy to parse for third party programs.