re-applied Peter Hartlich's and Jukkas dmenu-related patches, for odd reasons they...
authorAnselm R Garbe <garbeam@gmail.com>
Wed, 9 Apr 2008 22:31:49 +0000 (23:31 +0100)
committerAnselm R Garbe <garbeam@gmail.com>
Wed, 9 Apr 2008 22:31:49 +0000 (23:31 +0100)
config.mk
dmenu_path
dmenu_run

index 3cc8b32..30e8b64 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dmenu version
-VERSION = 3.6
+VERSION = 3.7
 
 # Customize below to fit your system
 
index d0a32c5..a9ddd47 100755 (executable)
@@ -3,24 +3,24 @@ CACHE=$HOME/.dmenu_cache
 IFS=:
 
 uptodate() {
-       test ! -f $CACHE && return 1
+       test -f "$CACHE" &&
        for dir in $PATH
        do
-               test $dir -nt $CACHE && return 1
+               test ! $dir -nt "$CACHE" || return 1
        done
-       return 0
 }
 
 if ! uptodate
 then
        for dir in $PATH
        do
-               for file in "$dir"/*
+               cd "$dir" &&
+               for file in *
                do
-                       test -x "$file" && echo "${file##*/}"
+                       test -x "$file" && echo "$file"
                done
-       done | sort | uniq > $CACHE.$$
-       mv $CACHE.$$ $CACHE
+       done | sort -u > "$CACHE".$$ &&
+       mv "$CACHE".$$ "$CACHE"
 fi
 
-cat $CACHE
+cat "$CACHE"
index 1cecc16..3e1e6e4 100755 (executable)
--- a/dmenu_run
+++ b/dmenu_run
@@ -1,2 +1,2 @@
 #!/bin/sh
-exe=`dmenu_path | dmenu $*` && exec $exe
+exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe