[hackers] [dmenu][PATCH] Replace dmenu_run shell with executed application

From: Jan Bessai <jan.bessai_AT_tu-dortmund.de>
Date: Sun, 30 Dec 2018 13:41:39 +0100

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
_AT_@ -1,2 +1,2 @@
 #!/bin/sh
-dmenu_path | dmenu "$_AT_" | ${SHELL:-"/bin/sh"} &
+exec `dmenu_path | dmenu "$_AT_"`
-- 
2.20.1
Received on Sun Dec 30 2018 - 13:41:39 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 30 2018 - 13:48:21 CET