From: Connor Lane Smith Date: Mon, 17 Oct 2011 09:08:04 +0000 (+0100) Subject: merge lsx -> default X-Git-Url: https://git.xinqibao.xyz/dmenu.git/commitdiff_plain/5e0156c0727fa8f225c3309f265da241a98edc08?hp=7bbd4c56ebe1c91b90561e7f22e875f58e7facc9 merge lsx -> default --- diff --git a/dmenu.c b/dmenu.c index f105b56..dc1f236 100644 --- a/dmenu.c +++ b/dmenu.c @@ -41,7 +41,6 @@ static void usage(void); static char text[BUFSIZ] = ""; static int bh, mw, mh; static int inputw, promptw; -static int lines = 0; static size_t cursor = 0; static const char *font = NULL; static const char *prompt = NULL; @@ -49,6 +48,7 @@ static const char *normbgcolor = "#cccccc"; static const char *normfgcolor = "#000000"; static const char *selbgcolor = "#0066ff"; static const char *selfgcolor = "#ffffff"; +static unsigned int lines = 0; static unsigned long normcol[ColLast]; static unsigned long selcol[ColLast]; static Atom utf8; diff --git a/dmenu_run b/dmenu_run index 2d12243..21dc72b 100755 --- a/dmenu_run +++ b/dmenu_run @@ -1,9 +1,12 @@ #!/bin/sh CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run +if [ ! -d "`dirname "$CACHE"`" ]; then + CACHE=$HOME/.dmenu_cache +fi ( IFS=: if test "`ls -dt $PATH "$CACHE" 2> /dev/null | sed 1q`" != "$CACHE"; then - mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE" + lsx $PATH | sort -u > "$CACHE" fi ) cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd"