Re: [hackers] [dmenu][PATCH] Allow only one dmenu_run selection

From: Christopher Lang <christopher.lang.256_AT_gmail.com>
Date: Wed, 30 Aug 2023 17:41:28 +0100

On Wed, Aug 30, 2023 at 05:48:13PM +0200, Страхиња Радић wrote:
> On 23/08/30 09:43AM, Randy Palamar wrote:
> > Personally I see little need for such a patch. I don't really
> > think anyone is pressing <CTRL>+<RETURN> by mistake; they
> > are nowhere near each other on most (all?) keyboard layouts.

A dmenu script in the dmenu repository should set the example for how to
properly use dmenu. If dmenu_run has this (albiet small) bug, then it
could make users assume dmenu always outputs a single line.

> > Actually I didn't even know about this feature despite using
> > dmenu in a number of different scripts for many years. I'm
> > already thinking of some use cases.

If users saw that dmenu_run was handling multi line output from dmenu,
it could alert them to this feature.

> I would actually turn this patch the other way around--and have multiple
> selection execute all the selected commands.

This would be my implementation for executing all selected commands:

#!/bin/sh
for x in $(dmenu_path | dmenu "$_AT_"); 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?

--
Christopher
Received on Wed Aug 30 2023 - 18:41:28 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 30 2023 - 19:12:50 CEST