diff options
-rw-r--r-- | dmenu.c | 6 | ||||
-rwxr-xr-x | dmenu_run | 17 |
2 files changed, 13 insertions, 10 deletions
@@ -117,7 +117,7 @@ main(int argc, char *argv[]) { setup(); run(); - return EXIT_FAILURE; /* unreachable */ + return 1; /* unreachable */ } void @@ -575,12 +575,12 @@ setup(void) { /* create menu window */ swa.override_redirect = True; - swa.background_pixmap = ParentRelative; + swa.background_pixel = normcol[ColBG]; swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; win = XCreateWindow(dc->dpy, root, x, y, mw, mh, 0, DefaultDepth(dc->dpy, screen), CopyFromParent, DefaultVisual(dc->dpy, screen), - CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa); + CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); /* open input methods */ xim = XOpenIM(dc->dpy, NULL, NULL, NULL); @@ -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 # if no xdg dir, fall back to dotfile in ~ fi ( IFS=: - if stest -dqr -n "$CACHE" $PATH; then - stest -flx $PATH | sort -u > "$CACHE" + if stest -dqr -n "$cache" $PATH; then + stest -flx $PATH | sort -u | tee "$cache" | dmenu "$@" + else + dmenu "$@" < "$cache" fi -) -cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd" +) | ${SHELL:-"/bin/sh"} & |