sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 799422e874ed49b63cc6265d8cb551b901658bf0
parent 522724b727a0d0787ce3ba6867f5c75aeafaa730
Author: Rob Pilling <my name at gmail dot com>
Date:   Wed, 18 Aug 2010 11:04:09 +0100

Updated incremental patch to apply cleanly to tip
Diffstat:
Mtools.suckless.org/dmenu/patches/dmenu-tip-incremental.diff | 85++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mtools.suckless.org/dmenu/patches/incremental.md | 6+++---
2 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/tools.suckless.org/dmenu/patches/dmenu-tip-incremental.diff b/tools.suckless.org/dmenu/patches/dmenu-tip-incremental.diff @@ -1,61 +1,62 @@ -diff -r 67d8f41d51d7 dmenu.1 ---- a/dmenu.1 Fri Jul 02 06:49:05 2010 +0100 -+++ b/dmenu.1 Fri Jul 23 18:32:04 2010 +0100 +diff -r ccb2b92086bf dmenu.1 +--- a/dmenu.1 Thu Aug 12 15:35:51 2010 +0100 ++++ b/dmenu.1 Wed Aug 18 10:59:14 2010 +0100 @@ -5,6 +5,7 @@ .B dmenu - .RB [ \-i ] .RB [ \-b ] + .RB [ \-i ] +.RB [ \-r ] - .RB [ \-e " <xid>]" - .RB [ \-l " <lines>]" - .RB [ \-fn " <font>]" -@@ -38,6 +39,9 @@ - .B \-b - defines that dmenu appears at the bottom. + .RB [ \-l + .IR lines ] + .RB [ \-p +@@ -48,6 +49,9 @@ + .B \-i + dmenu matches menu items case insensitively. .TP +.B \-r -+outputs the entered text, incrementally. ++dmenu outputs text each time a key is pressed. +.TP - .B \-e <xid> - reparents dmenu to the window specified by xid. + .BI \-l " lines" + dmenu lists items vertically, with the given number of lines. .TP -diff -r 67d8f41d51d7 dmenu.c ---- a/dmenu.c Fri Jul 02 06:49:05 2010 +0100 -+++ b/dmenu.c Fri Jul 23 18:32:04 2010 +0100 -@@ -34,6 +34,7 @@ - static char *maxname = NULL; - static unsigned int cmdw = 0; - static unsigned int lines = 0; -+static int incremental = 0; - static Item *allitems = NULL; /* first of all items */ - static Item *item = NULL; /* first of pattern matching items */ - static Item *sel = NULL; -@@ -331,6 +332,10 @@ - dinput(); +diff -r ccb2b92086bf dmenu.c +--- a/dmenu.c Thu Aug 12 15:35:51 2010 +0100 ++++ b/dmenu.c Wed Aug 18 10:59:14 2010 +0100 +@@ -53,7 +53,7 @@ + static unsigned long normcol[ColLast]; + static unsigned long selcol[ColLast]; + static Atom utf8; +-static Bool topbar = True; ++static Bool topbar = True, incremental = False; + static DC *dc; + static Item *items = NULL; + static Item *matches, *sel; +@@ -317,6 +317,10 @@ + match(); break; } + if(incremental) { + fprintf(stdout, "%s\n", text); + fflush(stdout); + } - drawbar(); + drawmenu(); + } + +@@ -487,7 +491,7 @@ + + void + usage(void) { +- fputs("usage: dmenu [-b] [-i] [-l lines] [-p prompt] [-fn font] [-nb color]\n" ++ fputs("usage: dmenu [-b] [-r] [-i] [-l lines] [-p prompt] [-fn font] [-nb color]\n" + " [-nf color] [-sb color] [-sf color] [-v]\n", stderr); + exit(EXIT_FAILURE); } - -@@ -413,6 +418,8 @@ +@@ -505,6 +509,8 @@ } else if(!strcmp(argv[i], "-b")) topbar = False; + else if(!strcmp(argv[i], "-r")) -+ incremental = 1; - else if(!strcmp(argv[i], "-l")) { - if(++i < argc) lines = atoi(argv[i]); - if(lines > 0) -@@ -441,7 +448,7 @@ - exit(EXIT_SUCCESS); - } - else { -- fputs("usage: dmenu [-i] [-b] [-l <lines>] [-fn <font>] [-nb <color>]\n" -+ fputs("usage: dmenu [-i] [-b] [-r] [-l <lines>] [-fn <font>] [-nb <color>]\n" - " [-nf <color>] [-p <prompt>] [-sb <color>] [-sf <color>] [-v]\n", stderr); - exit(EXIT_FAILURE); - } ++ incremental = True; + else if(!strcmp(argv[i], "-i")) + fstrncmp = strncasecmp; + else if(i == argc-1) diff --git a/tools.suckless.org/dmenu/patches/incremental.md b/tools.suckless.org/dmenu/patches/incremental.md @@ -5,9 +5,9 @@ This patch causes dmenu to print out the current text each time a key is pressed This is useful as an incremental search feature, for example in surf's config.h: -`#define INCSEARCH { .v = (char *[]){ "/bin/sh", "-c", \ - "dmenu -r < /dev/null | while read -r find;do xprop -id $0 -f _SURF_FIND 8s "\ - "-set _SURF_FIND \"$find\";done", \ +`#define INCSEARCH { .v = (char *[]){ "/bin/sh", "-c", + "dmenu -r < /dev/null | while read -r find; do xprop -id $0 -f _SURF_FIND 8s " + "-set _SURF_FIND \"$find\"; done", winid, NULL } }`