bemenu icon indicating copy to clipboard operation
bemenu copied to clipboard

library: allow for custom filters

Open SevereOverfl0w opened this issue 3 years ago • 3 comments

I'm using bemenu with the todo.txt format. I'd like to have access to some of the fancy filters that are available in topydo, such as time filters (e.g. due:<today) but also negation.

One option here would be to allow clients to implement custom filters.

SevereOverfl0w avatar Mar 22 '21 21:03 SevereOverfl0w

Implementing native filters is already quite simple: https://github.com/Cloudef/bemenu/blob/master/lib/menu.c#L35-L38 https://github.com/Cloudef/bemenu/blob/master/lib/bemenu.h#L147-L151

External filters could perhaps be implemented by implementing lua scripting or calling a external program. The latter might be slow for large lists however. Calling a external program might be worth experimenting however, there's some simple optimization one can do like not filtering immediately on user input.

External program could be fast, if it was only launched once, but bemenu would communicate with it over pipe.

Cloudef avatar Mar 23 '21 05:03 Cloudef

Is it possible when writing a bemenu client to implement a custom native filter right now? Just making sure I understand that limitation, it seemed to me that the list of possible filters was just the 3 in https://github.com/Cloudef/bemenu/blob/master/lib/bemenu.h?rgh-link-date=2021-03-23T05%3A35%3A58Z#L147-L151 and no more could be added without modifying bemenu itself?

SevereOverfl0w avatar Mar 23 '21 09:03 SevereOverfl0w

Native means modifying the bemenu itself indeed. Maybe they could be separated into dynamic libs instead perhaps.

Cloudef avatar Mar 23 '21 09:03 Cloudef