[dev] [dmenu] Patch to only allow choosing and returning one of the given entries

From: Bert Münnich <ber.t_AT_gmx.com>
Date: Sun, 30 Jan 2011 16:17:46 +0100

Hi folks,

I keep a file containing a list of gui applications to pipe into dmenu,
so that I could only start those applications that do make sense in the
graphical environment.

However, since vanilla dmenu allows to insert any arbitrary text, this
isn't fool-proof, I could still type "dd" hit Return and fork a running
program that never stops until I kill it (please don't tell me, that
this is a human problem and should not yield to patch dmenu).

The attached simplechoice patch adds the command line switch '-c', which
causes dmenu to only allow selecting one of the given entries. It does
still work as normal, i.e. typing text results in filtering out the
not-matching entries.

It's also useful in other cases, for example to select a bookmark to
open in surf. So it might be useful to others, which is why I'm mailing
it to the list...

Bert

Received on Sun Jan 30 2011 - 16:17:46 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 30 2011 - 16:36:02 CET