Re: [dev] dmenu : auto confirm when only one item remains

From: Donald Chai <donald.chai_AT_gmail.com>
Date: Wed, 12 Aug 2009 12:56:41 -0700

On Aug 12, 2009, at 11:39 AM, Julien Steinhauser wrote:

> Hello,
> Sorry, I don't write to bring a patch.
> I wander if someone has already patched dwm
> to make it auto confirm when, (as said in the subject)
> only one item remains.
>
> I've found something on the mailing list which is almost
> what I wish but not exactly, it auto confirms on exact match.
>
> It could be something like :
> <pseudocode>
> if number of Item == 1 or if firstItem == lastItem
> </pseudocode>
> fprintf(stdout, "%s", text);
> fflush(stdout);
> running = False;
>
> As I'm not a developper, I miss the knowledge
> to write the if condition in real code.

You're so close!

Adding the following lines to the end of the match(void) procedure
should do the trick:
         if(item && item==itemend) {
             fprintf(stdout, "%s", item->text);
             fflush(stdout);
             running = False;
         }
Received on Wed Aug 12 2009 - 19:56:41 UTC

This archive was generated by hypermail 2.2.0 : Sun Aug 16 2009 - 14:18:43 UTC