Re: [dev] [hack] Having dmenu provide hints about current selected entry

From: Ramil Farkhshatov <>
Date: Wed, 01 Dec 2010 04:34:43 +0300

Christophe-Marie Duquesne <> wrote:

> On Mon, Nov 29, 2010 at 2:44 AM, Connor Lane Smith <> wrote:
> > Great, it's a lot cleaner this way. One problem with this approach,
> > though, is that if data is written to stdin it isn't displayed until
> > the next X event. This is likely fine for your use case, and
> > dmenu_run, but perhaps not for other cases. To fix that we'd have to
> > select between stdin and XConnectionNumber(dc->dpy).
> Here is a patch that implements this idea (still available on my
> bitbucket repo). It actually makes dmenu pretty slow to read stdin.
> comments/fix are welcome.

Attached patch against dmenu-4.2.1 is based on yours but with some

It reads stdin by blocks not by line that is noticeably reduces number
of invokes of readstdin() and whole select() machinery.
And it doesn't run match() on each item, that increases speed and
reduces cpu usage. But conditions to run match() must be reconsidered:
in this patch it is called once a second.

Received on Wed Dec 01 2010 - 02:34:43 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 01 2010 - 02:48:03 CET