On Wed, Aug 30, 2023 at 11:25:18AM -0700, Jeremy wrote:
> On 08/30/23 05:41PM, Christopher Lang wrote:
> > This would be my implementation for executing all selected commands:
> > 
> > #!/bin/sh
> > for x in $(dmenu_path | dmenu "$@"); do
> >   echo "$x" | ${SHELL:-"/bin/sh"} &
> > done
> > 
> > I suppose this behaviour is more intuitive, but it is a little more
> > complicated. What are peoples preferences between original patch and
> > executing all commands?
> > 
> 
> The darker color on the "selected" items makes me think the blocking
> effect of the `$()` makes the most sense, with two exceptions:
>       - the selected options are run in the same order as the input
>       - each selected option is only run once
> 
> Which would look like:
> 
> #!/bin/sh
> t=$(mktemp)
> dmenu_path | tee "$t" | dmenu "$@" | awk 'NR==FNR { x[$0]++; next } x[$0]' - 
> "$t" | sh -x
> 
> Jeremy
> 

If this route is taken I think it would make more sense to not print the lines
directly when CTRL-Enter is used to select multiple lines.
And flush all selected lines on output.

This would make sense for dmenu_run but not some existing scripts that use it.

-- 
Kind regards,
Hiltjo

Reply via email to