aboutsummaryrefslogtreecommitdiff
path: root/desktop/dmenu/dmenu_path
diff options
context:
space:
mode:
authorPhillip Warner <pc_warner@yahoo.com>2011-07-25 23:27:41 -0500
committerNiels Horn <niels.horn@slackbuilds.org>2011-08-11 20:28:35 -0300
commit2cbbd42d56388488e99dcdb0a4b630111fa4b5d0 (patch)
tree16a4d6c115aea710548ddd291c47391a7eaf176b /desktop/dmenu/dmenu_path
parentb05b92f5b977c14e74f384af25ff5d65b9acdf8d (diff)
desktop/dmenu: Revert to the dmenu_path script from 4.1.1
The dmenu_path in dmenu 4.3.1 seems to be picking up non-executables on my system. I was thinking of waiting until upstream fixes this, but there is still some churn going on regarding the dmenu_run/path scripts. I figured it would be better to get this small fix out there in the mean time. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'desktop/dmenu/dmenu_path')
-rw-r--r--desktop/dmenu/dmenu_path26
1 files changed, 26 insertions, 0 deletions
diff --git a/desktop/dmenu/dmenu_path b/desktop/dmenu/dmenu_path
new file mode 100644
index 0000000000000..7896a9e957fa1
--- /dev/null
+++ b/desktop/dmenu/dmenu_path
@@ -0,0 +1,26 @@
+#!/bin/sh
+CACHE=$HOME/.dmenu_cache
+IFS=:
+
+uptodate() {
+ test -f "$CACHE" &&
+ for dir in $PATH
+ do
+ test ! $dir -nt "$CACHE" || return 1
+ done
+}
+
+if ! uptodate
+then
+ for dir in $PATH
+ do
+ cd "$dir" &&
+ for file in *
+ do
+ test -x "$file" && echo "$file"
+ done
+ done | sort | uniq > "$CACHE".$$ &&
+ mv "$CACHE".$$ "$CACHE"
+fi
+
+cat "$CACHE"