git clone dmenu dmenu Log gph
Found at: gopher.r-36.net:70/scm/dmenu/commit/a02a1a662362a1e74f627c7f47335b5aeda79c67.gph
tfaster dmenu_run -f - dmenu - Dmenu fork with xft fonts.
git clone git://r-36.net/dmenu
---
commit a02a1a662362a1e74f627c7f47335b5aeda79c67
parent 8ac44eb75a3e2190aa7b89548956b2de33c5a6ce
Date: Sat, 19 Nov 2011 21:24:07 +0100
faster dmenu_run -f
Diffstat:
dmenu.c | 2 +-
dmenu_run | 17 ++++++++++-------
2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/dmenu.c b/dmenu.c
t@@ -117,7 +117,7 @@ main(int argc, char *argv[]) {
setup();
run();
- return EXIT_FAILURE; /* unreachable */
+ return 1; /* unreachable */
}
void
diff --git a/dmenu_run b/dmenu_run
t@@ -1,12 +1,15 @@
#!/bin/sh
-CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
-if [ ! -d "`dirname "$CACHE"`" ]; then
- CACHE=$HOME/.dmenu_cache
+cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
+if [ -d "$cachedir" ]; then
+ cache=$cachedir/dmenu_run
+else
+ cache=$HOME/.dmenu_cache
fi
(
IFS=:
- if [ "`ls -dt $PATH "$CACHE" | head -n 1`" != "$CACHE" ]; then
- lsx $PATH | sort -u > "$CACHE"
+ if [ "`ls -dt $PATH "$cache" | head -n 1`" != "$cache" ]; then
+ lsx $PATH | sort -u | tee "$cache" | dmenu "$@"
+ else
+ dmenu "$@" < "$cache"
fi
-)
-cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd"
+) | read cmd && exec sh -c "$cmd"
.