Hi

[2018-12-30 13:41] Jan Bessai <jan.bes...@tu-dortmund.de>
>
> Currently dmenu_run spawns a subshell and keeps running for each process
> it executes. Over time this litters up the process list with useless
> instances of dmenu_run, which do nothing but wait for their child to
> exit. The patch below replaces the dmenu_run process with its child,
> freeing up resources immediately. The difference is especially
> noticeable when dmenu is used in window managers.
>
> -- Jan
>
> ---
>  dmenu_run | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dmenu_run b/dmenu_run
> index 834ede5..5c9b4e8 100755
> --- a/dmenu_run
> +++ b/dmenu_run
> @@ -1,2 +1,2 @@
>  #!/bin/sh
> -dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
> +exec `dmenu_path | dmenu "$@"`

To keep this portable you should refrain from using backticks (`) and
use the POSIX-way:

exec $(dmenu_path | dmenu "$@")


Cheers,

Silvan

Reply via email to