diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-29 20:15:41 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-29 20:15:41 +0530 |
commit | a2ac0f921d6a9b33d0e70449ca2160c6ffc06855 (patch) | |
tree | 7d6b9d725801b80dd334cbb1d6027d87cd3e08db /diffs | |
parent | d4f6516165ff592ede27ad8c594f78553bd4d5b3 (diff) |
Diffstat (limited to 'diffs')
-rw-r--r-- | diffs/dmenu-border-20201112-1a13d04.diff | 50 | ||||
-rw-r--r-- | diffs/dmenu-caseinsensitive-20200523-db6093f.diff | 42 | ||||
-rw-r--r-- | diffs/dmenu-fuzzyhighlight-4.9.diff | 152 | ||||
-rw-r--r-- | diffs/dmenu-lineheight-5.0.diff | 106 | ||||
-rw-r--r-- | diffs/dmenu-morecolor-20190922-4bf895b.diff | 47 |
5 files changed, 0 insertions, 397 deletions
diff --git a/diffs/dmenu-border-20201112-1a13d04.diff b/diffs/dmenu-border-20201112-1a13d04.diff deleted file mode 100644 index bea0cee..0000000 --- a/diffs/dmenu-border-20201112-1a13d04.diff +++ /dev/null @@ -1,50 +0,0 @@ -From d0c3fc8a634c153856cd41438f705175a21ec69a Mon Sep 17 00:00:00 2001 -From: braskin <benjaminiraskin@gmail.com> -Date: Thu, 12 Nov 2020 10:13:29 -0500 -Subject: [PATCH] fixed border width draw for topbar - ---- - config.def.h | 3 +++ - dmenu.c | 6 +++++- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/config.def.h b/config.def.h -index 1edb647..dd3eb31 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -21,3 +21,6 @@ static unsigned int lines = 0; - * for example: " /?\"&[]" - */ - static const char worddelimiters[] = " "; -+ -+/* Size of the window border */ -+static unsigned int border_width = 0; -diff --git a/dmenu.c b/dmenu.c -index 65f25ce..716e655 100644 ---- a/dmenu.c -+++ b/dmenu.c -@@ -659,9 +659,11 @@ setup(void) - swa.override_redirect = True; - swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; -- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0, -+ win = XCreateWindow(dpy, parentwin, x, y - (topbar ? 0 : border_width * 2), mw - border_width * 2, mh, border_width, - CopyFromParent, CopyFromParent, CopyFromParent, - CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); -+ if (border_width) -+ XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel); - XSetClassHint(dpy, win, &ch); - - -@@ -733,6 +735,8 @@ main(int argc, char *argv[]) - colors[SchemeSel][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-w")) /* embedding window id */ - embed = argv[++i]; -+ else if (!strcmp(argv[i], "-bw")) -+ border_width = atoi(argv[++i]); /* border width */ - else - usage(); - --- -2.25.1 - diff --git a/diffs/dmenu-caseinsensitive-20200523-db6093f.diff b/diffs/dmenu-caseinsensitive-20200523-db6093f.diff deleted file mode 100644 index 939a2e8..0000000 --- a/diffs/dmenu-caseinsensitive-20200523-db6093f.diff +++ /dev/null @@ -1,42 +0,0 @@ -From 54acbdf72083a5eae5783eed42e162424ab2cec2 Mon Sep 17 00:00:00 2001 -From: Kim Torgersen <kim@torgersen.se> -Date: Sat, 23 May 2020 14:48:28 +0200 -Subject: [PATCH] case-insensitive item matching default, case-sensitive option - (-s) - ---- - dmenu.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/dmenu.c b/dmenu.c -index 65f25ce..855df59 100644 ---- a/dmenu.c -+++ b/dmenu.c -@@ -55,8 +55,9 @@ static Clr *scheme[SchemeLast]; - - #include "config.h" - --static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; --static char *(*fstrstr)(const char *, const char *) = strstr; -+static char * cistrstr(const char *s, const char *sub); -+static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp; -+static char *(*fstrstr)(const char *, const char *) = cistrstr; - - static void - appenditem(struct item *item, struct item **list, struct item **last) -@@ -709,9 +710,9 @@ main(int argc, char *argv[]) - topbar = 0; - else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ - fast = 1; -- else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ -- fstrncmp = strncasecmp; -- fstrstr = cistrstr; -+ else if (!strcmp(argv[i], "-s")) { /* case-sensitive item matching */ -+ fstrncmp = strncmp; -+ fstrstr = strstr; - } else if (i + 1 == argc) - usage(); - /* these options take one argument */ --- -2.26.2 - diff --git a/diffs/dmenu-fuzzyhighlight-4.9.diff b/diffs/dmenu-fuzzyhighlight-4.9.diff deleted file mode 100644 index 58d5c6f..0000000 --- a/diffs/dmenu-fuzzyhighlight-4.9.diff +++ /dev/null @@ -1,152 +0,0 @@ -Author: Chris Noxz <chris@noxz.tech> -note: This patch is meant to be used together with fuzzymatch - -diff -upN dmenu-4.9/config.def.h dmenu-4.9-fuzzyhighlight/config.def.h ---- dmenu-4.9/config.def.h 2019-02-02 13:55:02.000000000 +0100 -+++ dmenu-4.9-fuzzyhighlight/config.def.h 2020-04-04 10:26:36.990890854 +0200 -@@ -11,6 +11,8 @@ static const char *colors[SchemeLast][2] - /* fg bg */ - [SchemeNorm] = { "#bbbbbb", "#222222" }, - [SchemeSel] = { "#eeeeee", "#005577" }, -+ [SchemeSelHighlight] = { "#ffc978", "#005577" }, -+ [SchemeNormHighlight] = { "#ffc978", "#222222" }, - [SchemeOut] = { "#000000", "#00ffff" }, - }; - /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ -diff -upN dmenu-4.9/dmenu.1 dmenu-4.9-fuzzyhighlight/dmenu.1 ---- dmenu-4.9/dmenu.1 2019-02-02 13:55:02.000000000 +0100 -+++ dmenu-4.9-fuzzyhighlight/dmenu.1 2020-04-04 10:30:16.430054933 +0200 -@@ -20,6 +20,14 @@ dmenu \- dynamic menu - .IR color ] - .RB [ \-sf - .IR color ] -+.RB [ \-nhb -+.IR color ] -+.RB [ \-nhf -+.IR color ] -+.RB [ \-shb -+.IR color ] -+.RB [ \-shf -+.IR color ] - .RB [ \-w - .IR windowid ] - .P -@@ -75,6 +83,18 @@ defines the selected background color. - .BI \-sf " color" - defines the selected foreground color. - .TP -+.BI \-nhb " color" -+defines the normal highlight background color. -+.TP -+.BI \-nhf " color" -+defines the normal highlight foreground color. -+.TP -+.BI \-shb " color" -+defines the selected highlight background color. -+.TP -+.BI \-shf " color" -+defines the selected highlight foreground color. -+.TP - .B \-v - prints version information to stdout, then exits. - .TP -diff -upN dmenu-4.9/dmenu.c dmenu-4.9-fuzzyhighlight/dmenu.c ---- dmenu-4.9/dmenu.c 2019-02-02 13:55:02.000000000 +0100 -+++ dmenu-4.9-fuzzyhighlight/dmenu.c 2020-04-04 10:27:43.888026309 +0200 -@@ -26,7 +26,9 @@ - #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - - /* enums */ --enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ -+enum { SchemeNorm, SchemeSel, SchemeNormHighlight, SchemeSelHighlight, -+ SchemeOut, SchemeLast }; /* color schemes */ -+ - - struct item { - char *text; -@@ -113,9 +115,49 @@ cistrstr(const char *s, const char *sub) - return NULL; - } - -+static void -+drawhighlights(struct item *item, int x, int y, int maxw) -+{ -+ int i, indent; -+ char *highlight; -+ char c; -+ -+ if (!(strlen(item->text) && strlen(text))) -+ return; -+ -+ drw_setscheme(drw, scheme[item == sel -+ ? SchemeSelHighlight -+ : SchemeNormHighlight]); -+ for (i = 0, highlight = item->text; *highlight && text[i];) { -+ if (*highlight == text[i]) { -+ /* get indentation */ -+ c = *highlight; -+ *highlight = '\0'; -+ indent = TEXTW(item->text); -+ *highlight = c; -+ -+ /* highlight character */ -+ c = highlight[1]; -+ highlight[1] = '\0'; -+ drw_text( -+ drw, -+ x + indent - (lrpad / 2), -+ y, -+ MIN(maxw - indent, TEXTW(highlight) - lrpad), -+ bh, 0, highlight, 0 -+ ); -+ highlight[1] = c; -+ i++; -+ } -+ highlight++; -+ } -+} -+ -+ - static int - drawitem(struct item *item, int x, int y, int w) - { -+ int r; - if (item == sel) - drw_setscheme(drw, scheme[SchemeSel]); - else if (item->out) -@@ -123,7 +165,9 @@ drawitem(struct item *item, int x, int y - else - drw_setscheme(drw, scheme[SchemeNorm]); - -- return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0); -+ r = drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0); -+ drawhighlights(item, x, y, w); -+ return r; - } - - static void -@@ -683,7 +727,8 @@ static void - usage(void) - { - fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" -- " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); -+ " [-nb color] [-nf color] [-sb color] [-sf color]\n" -+ " [-nhb color] [-nhf color] [-shb color] [-shf color] [-w windowid]\n", stderr); - exit(1); - } - -@@ -724,6 +769,14 @@ main(int argc, char *argv[]) - colors[SchemeSel][ColBg] = argv[++i]; - else if (!strcmp(argv[i], "-sf")) /* selected foreground color */ - colors[SchemeSel][ColFg] = argv[++i]; -+ else if (!strcmp(argv[i], "-nhb")) /* normal hi background color */ -+ colors[SchemeNormHighlight][ColBg] = argv[++i]; -+ else if (!strcmp(argv[i], "-nhf")) /* normal hi foreground color */ -+ colors[SchemeNormHighlight][ColFg] = argv[++i]; -+ else if (!strcmp(argv[i], "-shb")) /* selected hi background color */ -+ colors[SchemeSelHighlight][ColBg] = argv[++i]; -+ else if (!strcmp(argv[i], "-shf")) /* selected hi foreground color */ -+ colors[SchemeSelHighlight][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-w")) /* embedding window id */ - embed = argv[++i]; - else diff --git a/diffs/dmenu-lineheight-5.0.diff b/diffs/dmenu-lineheight-5.0.diff deleted file mode 100644 index 3b0df3d..0000000 --- a/diffs/dmenu-lineheight-5.0.diff +++ /dev/null @@ -1,106 +0,0 @@ -From ba103e38ea4ab07f9a3ee90627714b9bea17c329 Mon Sep 17 00:00:00 2001 -From: pskry <peter@skrypalle.dk> -Date: Sun, 8 Nov 2020 22:04:22 +0100 -Subject: [PATCH] Add an option which defines the lineheight - -Despite both the panel and dmenu using the same font (a Terminus 12), -dmenu is shorter and the panel is visible from under the dmenu bar. -The appearance can be even more distracting when using similar colors -for background and selections. With the option added by this patch, -dmenu can be launched with a '-h 24', thus completely covering the panel. ---- - config.def.h | 3 +++ - dmenu.1 | 5 +++++ - dmenu.c | 11 ++++++++--- - 3 files changed, 16 insertions(+), 3 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 1edb647..4394dec 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -15,6 +15,9 @@ static const char *colors[SchemeLast][2] = { - }; - /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ - static unsigned int lines = 0; -+/* -h option; minimum height of a menu line */ -+static unsigned int lineheight = 0; -+static unsigned int min_lineheight = 8; - - /* - * Characters not considered part of a word while deleting words -diff --git a/dmenu.1 b/dmenu.1 -index 323f93c..f2a82b4 100644 ---- a/dmenu.1 -+++ b/dmenu.1 -@@ -6,6 +6,8 @@ dmenu \- dynamic menu - .RB [ \-bfiv ] - .RB [ \-l - .IR lines ] -+.RB [ \-h -+.IR height ] - .RB [ \-m - .IR monitor ] - .RB [ \-p -@@ -50,6 +52,9 @@ dmenu matches menu items case insensitively. - .BI \-l " lines" - dmenu lists items vertically, with the given number of lines. - .TP -+.BI \-h " height" -+dmenu uses a menu line of at least 'height' pixels tall, but no less than 8. -+.TP - .BI \-m " monitor" - dmenu is displayed on the monitor number supplied. Monitor numbers are starting - from 0. -diff --git a/dmenu.c b/dmenu.c -index 65f25ce..f2a4047 100644 ---- a/dmenu.c -+++ b/dmenu.c -@@ -131,7 +131,7 @@ drawmenu(void) - { - unsigned int curpos; - struct item *item; -- int x = 0, y = 0, w; -+ int x = 0, y = 0, fh = drw->fonts->h, w; - - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, 0, 0, mw, mh, 1, 1); -@@ -148,7 +148,7 @@ drawmenu(void) - curpos = TEXTW(text) - TEXTW(&text[cursor]); - if ((curpos += lrpad / 2 - 1) < w) { - drw_setscheme(drw, scheme[SchemeNorm]); -- drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0); -+ drw_rect(drw, x + curpos, 2 + (bh - fh) / 2, 2, fh - 4, 1, 0); - } - - if (lines > 0) { -@@ -609,6 +609,7 @@ setup(void) - - /* calculate menu geometry */ - bh = drw->fonts->h + 2; -+ bh = MAX(bh,lineheight); /* make a menu line AT LEAST 'lineheight' tall */ - lines = MAX(lines, 0); - mh = (lines + 1) * bh; - #ifdef XINERAMA -@@ -689,7 +690,7 @@ setup(void) - static void - usage(void) - { -- fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" -+ fputs("usage: dmenu [-bfiv] [-l lines] [-h height] [-p prompt] [-fn font] [-m monitor]\n" - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); - exit(1); - } -@@ -717,6 +718,10 @@ main(int argc, char *argv[]) - /* these options take one argument */ - else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */ - lines = atoi(argv[++i]); -+ else if (!strcmp(argv[i], "-h")) { /* minimum height of one menu line */ -+ lineheight = atoi(argv[++i]); -+ lineheight = MAX(lineheight, min_lineheight); -+ } - else if (!strcmp(argv[i], "-m")) - mon = atoi(argv[++i]); - else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */ --- -2.29.2 - diff --git a/diffs/dmenu-morecolor-20190922-4bf895b.diff b/diffs/dmenu-morecolor-20190922-4bf895b.diff deleted file mode 100644 index 539e9c1..0000000 --- a/diffs/dmenu-morecolor-20190922-4bf895b.diff +++ /dev/null @@ -1,47 +0,0 @@ -From 4bf895be219ae00394a5cde901dc43ec6dcb3759 Mon Sep 17 00:00:00 2001 -From: Tanner Babcock <babkock@gmail.com> -Date: Sun, 22 Sep 2019 03:07:26 -0500 -Subject: [PATCH] Additional color scheme, for adjacent entries - ---- - config.def.h | 1 + - dmenu.c | 4 +++- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/config.def.h b/config.def.h -index 1edb647..767c88f 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -12,6 +12,7 @@ static const char *colors[SchemeLast][2] = { - [SchemeNorm] = { "#bbbbbb", "#222222" }, - [SchemeSel] = { "#eeeeee", "#005577" }, - [SchemeOut] = { "#000000", "#00ffff" }, -+ [SchemeMid] = { "#eeeeee", "#770000" }, - }; - /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ - static unsigned int lines = 0; -diff --git a/dmenu.c b/dmenu.c -index 65f25ce..0a5c08d 100644 ---- a/dmenu.c -+++ b/dmenu.c -@@ -26,7 +26,7 @@ - #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - - /* enums */ --enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ -+enum { SchemeNorm, SchemeSel, SchemeOut, SchemeMid, SchemeLast }; /* color schemes */ - - struct item { - char *text; -@@ -118,6 +118,8 @@ drawitem(struct item *item, int x, int y, int w) - { - if (item == sel) - drw_setscheme(drw, scheme[SchemeSel]); -+ else if (item->left == sel || item->right == sel) -+ drw_setscheme(drw, scheme[SchemeMid]); - else if (item->out) - drw_setscheme(drw, scheme[SchemeOut]); - else --- -2.23.0 - |