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 "$@"`
-- 
2.20.1

Reply via email to