mako icon indicating copy to clipboard operation
mako copied to clipboard

Implement `makoctl count` script command with variants

Open fidelicura opened this issue 1 year ago • 2 comments

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.

fidelicura avatar Jul 22 '24 23:07 fidelicura

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?

emersion avatar Jul 30 '24 17:07 emersion

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?

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.

fidelicura avatar Aug 04 '24 06:08 fidelicura

Yeah, I think I'd rather have the user use busctl + jq directly.

emersion avatar Feb 06 '25 19:02 emersion