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