Implement `makoctl count` script command with variants
This PR adds new command to makoctl as makoctl count. It allows a user to get number of notifications that are currently in history or in a waiting state. It may be useful for software producing a lot of notifications (e.g. single-point DBs) or any other use case where notifications are used as counter for something. The result looks like this:
{
"type" : "u",
"data" : [
5
]
}
...where 5 is the number of notifications in the history or on the screen (waiting) at the moment.
See also original idea from 2017 in dunst. It is the same sub-command that was initially named status, and now named count: issue, commit.
Do we really need to add a new D-Bus method here? Couldn't we use the same as makoctl list and use jq to count the number of entries?
Do we really need to add a new D-Bus method here? Couldn't we use the same as
makoctl listand usejqto count the number of entries?
Now I don't think we need a new D-Bus method, so no. I did it as a script command in the latest force-push, but I think it is not that necessary anymore if the user can just use jq for this purpose. I won't be upset if you just close this PR.
Yeah, I think I'd rather have the user use busctl + jq directly.