Re: [dev] dmenu -m "new%patch" -d "%"

From: Troels Henriksen <athas_AT_sigkill.dk>
Date: Tue, 11 May 2010 14:54:00 +0200

Connor Lane Smith <cls_AT_lubutu.com> writes:

> Hey,
>
> On 11/05/2010, Martin Ellis <ellism88_AT_gmail.com> wrote:
>> We had a strange situation where putting the menu in stdin was difficult.
>>
>> For our situation supplying the menu on the command line would be easier.
>>
>> Attached is a patch that provides this.
>
> I wrote one similar to this, except each argument after the flags is a
> menu item, and it's only +3 LOC. I'm not sure why you need a delimiter
> and such, but maybe this patch works for your situation.
>
> The diff is against tip, since we're real close to releasing 4.1 anyway.
>
> Thanks,
> cls
>

Why not just use a simple wrapper script? I'm not very good at bourne
shell, but this works:

#!/bin/sh

cmd=dmenu

while [ $# -gt 0 ]; do
    case $1 in
        -m) shift;
            for elem in "$@"; do
                echo $elem
            done | $cmd && exit 0;;
        *) cmd="$cmd $1";;
    esac
    shift
done

-- 
\  Troels
/\ Henriksen
Received on Tue May 11 2010 - 12:54:00 UTC

This archive was generated by hypermail 2.2.0 : Tue May 11 2010 - 13:00:03 UTC