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[]) { | |||
| 117 | setup(); | 117 | setup(); |
| 118 | run(); | 118 | run(); |
| 119 | 119 | ||
| 120 | return EXIT_FAILURE; /* unreachable */ | 120 | return 1; /* unreachable */ |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | void | 123 | void |
| @@ -575,12 +575,12 @@ setup(void) { | |||
| 575 | 575 | ||
| 576 | /* create menu window */ | 576 | /* create menu window */ |
| 577 | swa.override_redirect = True; | 577 | swa.override_redirect = True; |
| 578 | swa.background_pixmap = ParentRelative; | 578 | swa.background_pixel = normcol[ColBG]; |
| 579 | swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; | 579 | swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; |
| 580 | win = XCreateWindow(dc->dpy, root, x, y, mw, mh, 0, | 580 | win = XCreateWindow(dc->dpy, root, x, y, mw, mh, 0, |
| 581 | DefaultDepth(dc->dpy, screen), CopyFromParent, | 581 | DefaultDepth(dc->dpy, screen), CopyFromParent, |
| 582 | DefaultVisual(dc->dpy, screen), | 582 | DefaultVisual(dc->dpy, screen), |
| 583 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa); | 583 | CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); |
| 584 | 584 | ||
| 585 | /* open input methods */ | 585 | /* open input methods */ |
| 586 | xim = XOpenIM(dc->dpy, NULL, NULL, NULL); | 586 | xim = XOpenIM(dc->dpy, NULL, NULL, NULL); |
| @@ -1,12 +1,15 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run | 2 | cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} |
| 3 | if [ ! -d "`dirname "$CACHE"`" ]; then | 3 | if [ -d "$cachedir" ]; then |
| 4 | CACHE=$HOME/.dmenu_cache | 4 | cache=$cachedir/dmenu_run |
| 5 | else | ||
| 6 | cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~ | ||
| 5 | fi | 7 | fi |
| 6 | ( | 8 | ( |
| 7 | IFS=: | 9 | IFS=: |
| 8 | if stest -dqr -n "$CACHE" $PATH; then | 10 | if stest -dqr -n "$cache" $PATH; then |
| 9 | stest -flx $PATH | sort -u > "$CACHE" | 11 | stest -flx $PATH | sort -u | tee "$cache" | dmenu "$@" |
| 12 | else | ||
| 13 | dmenu "$@" < "$cache" | ||
| 10 | fi | 14 | fi |
| 11 | ) | 15 | ) | ${SHELL:-"/bin/sh"} & |
| 12 | cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd" | ||
