dmenu

my fork of dmenu
Index Commits Files Refs README LICENSE
commit 928b2b749512c2746191d67116afe26fc0617f0d
parent 1a13d0465d1a6f4f74bc5b07b04c9bd542f20ba6
Author: klewer-martin <martin.cachari@gmail.com>
Date:   Mon, 14 Mar 2022 20:41:30 -0300

update before modifing

Diffstat:
MMakefile | 2+-
Mconfig.def.h | 10+++++++++-
Mdmenu.1 | 35+++++++++++++++++++++++++++++++++++
Mdmenu.c | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
Apatches/dmenu-border-20201112-1a13d04.diff | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-border-4.9.diff | 25+++++++++++++++++++++++++
Apatches/dmenu-center-20200111-8cd37e1.diff | 120+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-dynamicoptions-20200526-01e2dfc7.diff | 134+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-grid-4.9.diff | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-highlight-4.9.diff | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-highpriority-4.9.diff | 178+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-lineheight-4.9.diff | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-lineheight-5.0.diff | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-mousesupport-5.0.diff | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-mousesupporthoverbgcol-20210123-1a13d04.diff | 196+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-nosort-5.0.diff | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-numbers-4.9.diff | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-xresources-4.9.diff | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apatches/dmenu-xyw-5.0.diff | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atags | 213+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20 files changed, 1999 insertions(+), 22 deletions(-)
diff --git a/Makefile b/Makefile
@@ -29,7 +29,7 @@ stest: stest.o
     $(CC) -o $@ stest.o $(LDFLAGS)
 
 clean:
-    rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz
+    rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz config.h
 
 dist: clean
     mkdir -p dmenu-$(VERSION)
diff --git a/config.def.h b/config.def.h
@@ -2,9 +2,11 @@
 /* Default settings; can be overriden by command line. */
 
 static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
+static int centered = 0;                    /* -c option; centers dmenu on screen */
+static int min_width = -200;                    /* minimum width when centered */
 /* -fn option overrides fonts[0]; default X11 font or font set */
 static const char *fonts[] = {
-    "monospace:size=10"
+    "DejaVuSansMono Nerd Font:style=Regular:size=8"
 };
 static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
 static const char *colors[SchemeLast][2] = {
@@ -15,9 +17,15 @@ 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
  * for example: " /?\"&[]"
  */
 static const char worddelimiters[] = " ";
+
+/* Size of the window border */
+static unsigned int border_width = 0;
diff --git a/dmenu.1 b/dmenu.1
@@ -6,8 +6,16 @@ dmenu \- dynamic menu
 .RB [ \-bfiv ]
 .RB [ \-l
 .IR lines ]
+.RB [ \-h
+.IR height ]
 .RB [ \-m
 .IR monitor ]
+.RB [ \-x
+.IR xoffset ]
+.RB [ \-y
+.IR yoffset ]
+.RB [ \-z
+.IR width ]
 .RB [ \-p
 .IR prompt ]
 .RB [ \-fn
@@ -40,6 +48,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
 .B \-b
 dmenu appears at the bottom of the screen.
 .TP
+.B \-c
+dmenu appears centered on the screen.
+.TP
 .B \-f
 dmenu grabs the keyboard before reading stdin if not reading from a tty. This
 is faster, but will lock up X until stdin reaches end\-of\-file.
@@ -47,13 +58,37 @@ is faster, but will lock up X until stdin reaches end\-of\-file.
 .B \-i
 dmenu matches menu items case insensitively.
 .TP
+.B \-S
+dmenu does not sort menu items after matching.
+.TP
 .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.
 .TP
+.BI \-x " xoffset"
+dmenu is placed at this offset measured from the left side of the monitor.
+Can be negative.
+If option
+.B \-m
+is present, the measurement will use the given monitor.
+.TP
+.BI \-y " yoffset"
+dmenu is placed at this offset measured from the top of the monitor.  If the
+.B \-b
+option is used, the offset is measured from the bottom.  Can be negative.
+If option
+.B \-m
+is present, the measurement will use the given monitor.
+.TP
+.BI \-z " width"
+sets the width of the dmenu window.
+.TP
 .BI \-p " prompt"
 defines the prompt to be displayed to the left of the input field.
 .TP
diff --git a/dmenu.c b/dmenu.c
@@ -1,6 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 #include <ctype.h>
 #include <locale.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -37,6 +38,9 @@ struct item {
 static char text[BUFSIZ] = "";
 static char *embed;
 static int bh, mw, mh;
+static int dmx = 0; /* put dmenu at this x offset */
+static int dmy = 0; /* put dmenu at this y offset (measured from the bottom if topbar is 0) */
+static unsigned int dmw = 0; /* make dmenu this wide */
 static int inputw = 0, promptw;
 static int lrpad; /* sum of left and right padding */
 static size_t cursor;
@@ -44,6 +48,7 @@ static struct item *items = NULL;
 static struct item *matches, *matchend;
 static struct item *prev, *curr, *next, *sel;
 static int mon = -1, screen;
+static bool sortmatches = true;
 
 static Atom clip, utf8;
 static Display *dpy;
@@ -79,8 +84,8 @@ calcoffsets(void)
     if (lines > 0)
         n = lines * bh;
     else
-        n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
-    /* calculate which items will begin the next page and previous page */
+    n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
+/* calculate which items will begin the next page and previous page */
     for (i = 0, next = curr; next; next = next->right)
         if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n)
             break;
@@ -89,6 +94,15 @@ calcoffsets(void)
             break;
 }
 
+static int
+max_textw(void)
+{
+    int len = 0;
+    for (struct item *item = items; item && item->text; item++)
+        len = MAX(TEXTW(item->text), len);
+    return len;
+}
+
 static void
 cleanup(void)
 {
@@ -131,7 +145,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 +162,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) {
@@ -236,13 +250,18 @@ match(void)
                 break;
         if (i != tokc) /* not all tokens match */
             continue;
-        /* exact matches go first, then prefixes, then substrings */
-        if (!tokc || !fstrncmp(text, item->text, textsize))
+
+        if (!sortmatches)
             appenditem(item, &matches, &matchend);
-        else if (!fstrncmp(tokv[0], item->text, len))
-            appenditem(item, &lprefix, &prefixend);
-        else
-            appenditem(item, &lsubstr, &substrend);
+        else {
+            /* exact matches go first, then prefixes, then substrings */
+            if (!tokc || !fstrncmp(text, item->text, textsize))
+                appenditem(item, &matches, &matchend);
+            else if (!fstrncmp(tokv[0], item->text, len))
+                appenditem(item, &lprefix, &prefixend);
+            else
+                appenditem(item, &lsubstr, &substrend);
+        }
     }
     if (lprefix) {
         if (matches) {
@@ -609,8 +628,10 @@ 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;
+    promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
 #ifdef XINERAMA
     i = 0;
     if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
@@ -637,9 +658,20 @@ setup(void)
                 if (INTERSECT(x, y, 1, 1, info[i]))
                     break;
 
-        x = info[i].x_org;
-        y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
-        mw = info[i].width;
+        if (centered) {
+            //mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
+            mw = (dmw>0 ? dmw : info[i].width);
+            x = info[i].x_org + ((info[i].width  - mw) / 2);
+            y = info[i].y_org + ((info[i].height - mh) / 2);
+//        x = info[i].x_org + dmx;
+//        y = info[i].y_org + (topbar ? dmy : info[i].height - mh - dmy);
+//        mw = (dmw>0 ? dmw : info[i].width);
+        } else {
+            x = info[i].x_org;
+            y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+            mw = info[i].width;
+        }
+
         XFree(info);
     } else
 #endif
@@ -647,11 +679,20 @@ setup(void)
         if (!XGetWindowAttributes(dpy, parentwin, &wa))
             die("could not get embedding window attributes: 0x%lx",
                 parentwin);
-        x = 0;
-        y = topbar ? 0 : wa.height - mh;
-        mw = wa.width;
+
+        if (centered) {
+            x = dmx;
+            y = topbar ? dmy : wa.height - mh - dmy;
+            mw = (dmw>0 ? dmw : wa.width);
+            //mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
+            //x = (wa.width  - mw) / 2;
+            //y = (wa.height - mh) / 2;
+        } else {
+            x = 0;
+            y = topbar ? 0 : wa.height - mh;
+            mw = wa.width;
+        }
     }
-    promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
     inputw = MIN(inputw, mw/3);
     match();
 
@@ -659,10 +700,12 @@ 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);
-    XSetClassHint(dpy, win, &ch);
+    if (border_width)
+        XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
+     XSetClassHint(dpy, win, &ch);
 
 
     /* input methods */
@@ -689,7 +732,8 @@ setup(void)
 static void
 usage(void)
 {
-    fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
+    fputs("usage: dmenu [-bfivS] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
+          "             [-x xoffset] [-y yoffset] [-z width]\n"
           "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
     exit(1);
 }
@@ -709,6 +753,10 @@ 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], "-S"))   /* do not sort matches */
+            sortmatches = false;
+        else if (!strcmp(argv[i], "-c"))   /* centers dmenu on screen */
+            centered = 1;
         else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
             fstrncmp = strncasecmp;
             fstrstr = cistrstr;
@@ -717,6 +765,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 */
@@ -733,6 +785,14 @@ 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], "-x"))   /* window x offset */
+            dmx = atoi(argv[++i]);
+        else if (!strcmp(argv[i], "-y"))   /* window y offset (from bottom up if -b) */
+            dmy = atoi(argv[++i]);
+        else if (!strcmp(argv[i], "-z"))   /* make dmenu this wide */
+            dmw = atoi(argv[++i]);
+        else if (!strcmp(argv[i], "-bw"))
+            border_width = atoi(argv[++i]); /* border width */
         else
             usage();
 
diff --git a/patches/dmenu-border-20201112-1a13d04.diff b/patches/dmenu-border-20201112-1a13d04.diff
@@ -0,0 +1,50 @@
+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/patches/dmenu-border-4.9.diff b/patches/dmenu-border-4.9.diff
@@ -0,0 +1,25 @@
+diff -up dmenu-4.9-b/config.def.h dmenu-4.9-a/config.def.h
+--- dmenu-4.9-b/config.def.h    2019-02-02 13:55:02.000000000 +0100
++++ dmenu-4.9-a/config.def.h    2019-05-19 02:10:12.740040403 +0200
+@@ -21,3 +21,6 @@ static unsigned int lines      = 0;
+  * for example: " /?\"&[]"
+  */
+ static const char worddelimiters[] = " ";
++
++/* Size of the window border */
++static const unsigned int border_width = 5;
+diff -up dmenu-4.9-b/dmenu.c dmenu-4.9-a/dmenu.c
+--- dmenu-4.9-b/dmenu.c    2019-02-02 13:55:02.000000000 +0100
++++ dmenu-4.9-a/dmenu.c    2019-05-19 02:11:20.966710117 +0200
+@@ -654,9 +654,10 @@ 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, mw, mh, border_width,
+                         CopyFromParent, CopyFromParent, CopyFromParent,
+                         CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
++    XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
+     XSetClassHint(dpy, win, &ch);
+ 
+     /* open input methods */
diff --git a/patches/dmenu-center-20200111-8cd37e1.diff b/patches/dmenu-center-20200111-8cd37e1.diff
@@ -0,0 +1,120 @@
+From 8cd37e1ab9e7cb025224aeb3543f1a5be8bceb93 Mon Sep 17 00:00:00 2001
+From: Nihal Jere <nihal@nihaljere.xyz>
+Date: Sat, 11 Jan 2020 21:16:08 -0600
+Subject: [PATCH] center patch now has adjustable minimum width
+
+---
+ config.def.h |  2 ++
+ dmenu.1      |  3 +++
+ dmenu.c      | 39 ++++++++++++++++++++++++++++++++-------
+ 3 files changed, 37 insertions(+), 7 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb647..88ef264 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -2,6 +2,8 @@
+ /* Default settings; can be overriden by command line. */
+ 
+ static int topbar = 1;                      /* -b  option; if 0, dmenu appears at bottom     */
++static int centered = 0;                    /* -c option; centers dmenu on screen */
++static int min_width = 500;                    /* minimum width when centered */
+ /* -fn option overrides fonts[0]; default X11 font or font set */
+ static const char *fonts[] = {
+     "monospace:size=10"
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..c036baa 100644
+--- a/dmenu.1
++++ b/dmenu.1
+@@ -40,6 +40,9 @@ which lists programs in the user's $PATH and runs the result in their $SHELL.
+ .B \-b
+ dmenu appears at the bottom of the screen.
+ .TP
++.B \-c
++dmenu appears centered on the screen.
++.TP
+ .B \-f
+ dmenu grabs the keyboard before reading stdin if not reading from a tty. This
+ is faster, but will lock up X until stdin reaches end\-of\-file.
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..041c7f8 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -89,6 +89,15 @@ calcoffsets(void)
+             break;
+ }
+ 
++static int
++max_textw(void)
++{
++    int len = 0;
++    for (struct item *item = items; item && item->text; item++)
++        len = MAX(TEXTW(item->text), len);
++    return len;
++}
++
+ static void
+ cleanup(void)
+ {
+@@ -611,6 +620,7 @@ setup(void)
+     bh = drw->fonts->h + 2;
+     lines = MAX(lines, 0);
+     mh = (lines + 1) * bh;
++    promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
+ #ifdef XINERAMA
+     i = 0;
+     if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) {
+@@ -637,9 +647,16 @@ setup(void)
+                 if (INTERSECT(x, y, 1, 1, info[i]))
+                     break;
+ 
+-        x = info[i].x_org;
+-        y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+-        mw = info[i].width;
++        if (centered) {
++            mw = MIN(MAX(max_textw() + promptw, min_width), info[i].width);
++            x = info[i].x_org + ((info[i].width  - mw) / 2);
++            y = info[i].y_org + ((info[i].height - mh) / 2);
++        } else {
++            x = info[i].x_org;
++            y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
++            mw = info[i].width;
++        }
++
+         XFree(info);
+     } else
+ #endif
+@@ -647,11 +664,17 @@ setup(void)
+         if (!XGetWindowAttributes(dpy, parentwin, &wa))
+             die("could not get embedding window attributes: 0x%lx",
+                 parentwin);
+-        x = 0;
+-        y = topbar ? 0 : wa.height - mh;
+-        mw = wa.width;
++
++        if (centered) {
++            mw = MIN(MAX(max_textw() + promptw, min_width), wa.width);
++            x = (wa.width  - mw) / 2;
++            y = (wa.height - mh) / 2;
++        } else {
++            x = 0;
++            y = topbar ? 0 : wa.height - mh;
++            mw = wa.width;
++        }
+     }
+-    promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
+     inputw = MIN(inputw, mw/3);
+     match();
+ 
+@@ -709,6 +732,8 @@ 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], "-c"))   /* centers dmenu on screen */
++            centered = 1;
+         else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
+             fstrncmp = strncasecmp;
+             fstrstr = cistrstr;
+-- 
+2.24.1
+
diff --git a/patches/dmenu-dynamicoptions-20200526-01e2dfc7.diff b/patches/dmenu-dynamicoptions-20200526-01e2dfc7.diff
@@ -0,0 +1,134 @@
+From 01e2dfc79126a7600463b4cf9fa16b4be6886cae Mon Sep 17 00:00:00 2001
+From: Tiago Teles <tiago.sequeira.teles@gmail.com>
+Date: Tue, 26 May 2020 19:55:55 +0100
+Subject: [PATCH] -dy flag for dynamic menu updating
+
+This patch adds a flag (`-dy`) which makes dmenu run the command given to it
+whenever input is changed with the current input as the last argument and
+update the option list according to the output of that command.
+---
+ config.def.h |  1 +
+ dmenu.c      | 43 ++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 37 insertions(+), 7 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb6477..035b8777 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -7,6 +7,7 @@ static const char *fonts[] = {
+     "monospace:size=10"
+ };
+ static const char *prompt      = NULL;      /* -p  option; prompt to the left of input field */
++static const char *dynamic     = NULL;      /* -dy option; dynamic command to run on input change */
+ static const char *colors[SchemeLast][2] = {
+     /*     fg         bg       */
+     [SchemeNorm] = { "#bbbbbb", "#222222" },
+diff --git a/dmenu.c b/dmenu.c
+index 6b8f51b5..356d4cc9 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -210,9 +210,33 @@ grabkeyboard(void)
+     die("cannot grab keyboard");
+ }
+ 
++static void readstdin(FILE* stream);
++
++static void
++refreshoptions(){
++    int dynlen = strlen(dynamic);
++    char* cmd= malloc(dynlen + strlen(text)+2);
++    if(cmd == NULL)
++        die("malloc:");
++    sprintf(cmd,"%s %s",dynamic, text);
++    FILE *stream = popen(cmd, "r");
++    if(!stream)
++        die("popen(%s):",cmd);
++    readstdin(stream);
++    int pc = pclose(stream);
++    if(pc == -1)
++        die("pclose:");
++    free(cmd);
++    curr = sel = items;
++}
++
+ static void
+ match(void)
+ {
++    if(dynamic && *dynamic){
++        refreshoptions();
++    }
++
+     static char **tokv = NULL;
+     static int tokn = 0;
+ 
+@@ -234,7 +258,7 @@ match(void)
+         for (i = 0; i < tokc; i++)
+             if (!fstrstr(item->text, tokv[i]))
+                 break;
+-        if (i != tokc) /* not all tokens match */
++        if (i != tokc && !(dynamic && *dynamic)) /* not all tokens match */
+             continue;
+         /* exact matches go first, then prefixes, then substrings */
+         if (!tokc || !fstrncmp(text, item->text, textsize))
+@@ -519,14 +543,14 @@ paste(void)
+ }
+ 
+ static void
+-readstdin(void)
++readstdin(FILE* stream)
+ {
+     char buf[sizeof text], *p;
+     size_t i, imax = 0, size = 0;
+     unsigned int tmpmax = 0;
+ 
+     /* read each line from stdin and add it to the item list */
+-    for (i = 0; fgets(buf, sizeof buf, stdin); i++) {
++    for (i = 0; fgets(buf, sizeof buf, stream); i++) {
+         if (i + 1 >= size / sizeof *items)
+             if (!(items = realloc(items, (size += BUFSIZ))))
+                 die("cannot realloc %u bytes:", size);
+@@ -544,7 +568,8 @@ readstdin(void)
+     if (items)
+         items[i].text = NULL;
+     inputw = items ? TEXTW(items[imax].text) : 0;
+-    lines = MIN(lines, i);
++    if (!dynamic || !*dynamic)
++        lines = MIN(lines, i);
+ }
+ 
+ static void
+@@ -683,7 +708,7 @@ 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] [-w windowid]\n" "[-dy command]\n", stderr);
+     exit(1);
+ }
+ 
+@@ -726,6 +751,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], "-dy"))  /* dynamic command to run */
++            dynamic = argv[++i];
+         else
+             usage();
+ 
+@@ -754,9 +781,11 @@ main(int argc, char *argv[])
+ 
+     if (fast && !isatty(0)) {
+         grabkeyboard();
+-        readstdin();
++        if(!(dynamic && *dynamic))
++            readstdin(stdin);
+     } else {
+-        readstdin();
++        if(!(dynamic && *dynamic))
++            readstdin(stdin);
+         grabkeyboard();
+     }
+     setup();
+-- 
+2.26.2
+
diff --git a/patches/dmenu-grid-4.9.diff b/patches/dmenu-grid-4.9.diff
@@ -0,0 +1,107 @@
+From 39ab9676914bd0d8105d0f96bbd7611a53077438 Mon Sep 17 00:00:00 2001
+From: Miles Alan <m@milesalan.com>
+Date: Sat, 4 Jul 2020 11:19:04 -0500
+Subject: [PATCH] Add -g option to display entries in the given number of grid
+ columns
+
+This option can be used in conjunction with -l to format dmenu's options in
+arbitrary size grids. For example, to create a 4 column by 6 line grid, you
+could use: dmenu -g 4 -l 6
+---
+ config.def.h |  3 ++-
+ dmenu.1      |  7 ++++++-
+ dmenu.c      | 22 ++++++++++++++++------
+ 3 files changed, 24 insertions(+), 8 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb647..96cf3c9 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -13,8 +13,9 @@ static const char *colors[SchemeLast][2] = {
+     [SchemeSel] = { "#eeeeee", "#005577" },
+     [SchemeOut] = { "#000000", "#00ffff" },
+ };
+-/* -l option; if nonzero, dmenu uses vertical list with given number of lines */
++/* -l and -g options; controls number of lines and columns in grid if > 0 */
+ static unsigned int lines      = 0;
++static unsigned int columns    = 0;
+ 
+ /*
+  * Characters not considered part of a word while deleting words
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..d0a734a 100644
+--- a/dmenu.1
++++ b/dmenu.1
+@@ -4,6 +4,8 @@ dmenu \- dynamic menu
+ .SH SYNOPSIS
+ .B dmenu
+ .RB [ \-bfiv ]
++.RB [ \-g
++.IR columns ]
+ .RB [ \-l
+ .IR lines ]
+ .RB [ \-m
+@@ -47,8 +49,11 @@ is faster, but will lock up X until stdin reaches end\-of\-file.
+ .B \-i
+ dmenu matches menu items case insensitively.
+ .TP
++.BI \-g " columns"
++dmenu lists items in a grid with the given number of columns.
++.TP
+ .BI \-l " lines"
+-dmenu lists items vertically, with the given number of lines.
++dmenu lists items in a grid with the given number of lines.
+ .TP
+ .BI \-m " monitor"
+ dmenu is displayed on the monitor number supplied. Monitor numbers are starting
+diff --git a/dmenu.c b/dmenu.c
+index 6b8f51b..d79b6bb 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -77,7 +77,7 @@ calcoffsets(void)
+     int i, n;
+ 
+     if (lines > 0)
+-        n = lines * bh;
++        n = lines * columns * bh;
+     else
+         n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
+     /* calculate which items will begin the next page and previous page */
+@@ -152,9 +152,15 @@ drawmenu(void)
+     }
+ 
+     if (lines > 0) {
+-        /* draw vertical list */
+-        for (item = curr; item != next; item = item->right)
+-            drawitem(item, x, y += bh, mw - x);
++        /* draw grid */
++        int i = 0;
++        for (item = curr; item != next; item = item->right, i++)
++            drawitem(
++                item,
++                x + ((i / lines) *  ((mw - x) / columns)),
++                y + (((i % lines) + 1) * bh),
++                (mw - x) / columns
++            );
+     } else if (matches) {
+         /* draw horizontal list */
+         x += inputw;
+@@ -708,9 +714,13 @@ main(int argc, char *argv[])
+         } else if (i + 1 == argc)
+             usage();
+         /* these options take one argument */
+-        else if (!strcmp(argv[i], "-l"))   /* number of lines in vertical list */
++        else if (!strcmp(argv[i], "-g")) {   /* number of columns in grid */
++            columns = atoi(argv[++i]);
++            if (lines == 0) lines = 1;
++        } else if (!strcmp(argv[i], "-l")) { /* number of lines in grid */
+             lines = atoi(argv[++i]);
+-        else if (!strcmp(argv[i], "-m"))
++            if (columns == 0) columns = 1;
++        } else if (!strcmp(argv[i], "-m"))
+             mon = atoi(argv[++i]);
+         else if (!strcmp(argv[i], "-p"))   /* adds prompt to left of input field */
+             prompt = argv[++i];
+-- 
+2.23.1
+
diff --git a/patches/dmenu-highlight-4.9.diff b/patches/dmenu-highlight-4.9.diff
@@ -0,0 +1,94 @@
+From a06d0d3d7bbb3c0f5bad44934dbbf1e88e7d9558 Mon Sep 17 00:00:00 2001
+From: Miles Alan <m@milesalan.com>
+Date: Sat, 4 Jul 2020 11:49:04 -0500
+Subject: [PATCH] Highlight matched text in a different color scheme
+
+---
+ config.def.h |  2 ++
+ dmenu.c      | 43 +++++++++++++++++++++++++++++++++++++++++--
+ 2 files changed, 43 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb647..64eab2a 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -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 --git a/dmenu.c b/dmenu.c
+index 6b8f51b..d5e1991 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, SchemeNormHighlight, SchemeSelHighlight, SchemeLast }; /* color schemes */
+ 
+ struct item {
+     char *text;
+@@ -113,6 +113,43 @@ cistrstr(const char *s, const char *sub)
+     return NULL;
+ }
+ 
++static void
++drawhighlights(struct item *item, int x, int y, int maxw)
++{
++    char restorechar, tokens[sizeof text], *highlight,  *token;
++    int indentx, highlightlen;
++
++    drw_setscheme(drw, scheme[item == sel ? SchemeSelHighlight : SchemeNormHighlight]);
++    strcpy(tokens, text);
++    for (token = strtok(tokens, " "); token; token = strtok(NULL, " ")) {
++        highlight = fstrstr(item->text, token);
++        while (highlight) {
++            // Move item str end, calc width for highlight indent, & restore
++            highlightlen = highlight - item->text;
++            restorechar = *highlight;
++            item->text[highlightlen] = '\0';
++            indentx = TEXTW(item->text);
++            item->text[highlightlen] = restorechar;
++
++            // Move highlight str end, draw highlight, & restore
++            restorechar = highlight[strlen(token)];
++            highlight[strlen(token)] = '\0';
++            if (indentx - (lrpad / 2) - 1 < maxw)
++                drw_text(
++                    drw,
++                    x + indentx - (lrpad / 2) - 1,
++                    y,
++                    MIN(maxw - indentx, TEXTW(highlight) - lrpad),
++                    bh, 0, highlight, 0
++                );
++            highlight[strlen(token)] = restorechar;
++
++            if (strlen(highlight) - strlen(token) < strlen(token)) break;
++            highlight = fstrstr(highlight + strlen(token), token);
++        }
++    }
++}
++
+ static int
+ drawitem(struct item *item, int x, int y, int w)
+ {
+@@ -123,7 +160,9 @@ drawitem(struct item *item, int x, int y, int w)
+     else
+         drw_setscheme(drw, scheme[SchemeNorm]);
+ 
+-    return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
++    int r = drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
++    drawhighlights(item, x, y, w);
++    return r;
+ }
+ 
+ static void
+-- 
+2.23.1
+
diff --git a/patches/dmenu-highpriority-4.9.diff b/patches/dmenu-highpriority-4.9.diff
@@ -0,0 +1,178 @@
+From e9e1691a9b4ffa2db45cd5108b76b9a68610ba37 Mon Sep 17 00:00:00 2001
+From: takase1121 <takase1121@outlook.com>
+Date: Sun, 17 May 2020 07:05:32 +0800
+Subject: [PATCH] Adds high-priority items.
+
+This allows users to specify a list of high priority commands that should be
+displayed before other matches with the following arrangement:
+
+match -> prefix && high priority -> prefix -> substring
+
+As you can see, high priority for substring matches is not implemented or will not
+be implemented depending on needs.
+---
+ config.def.h |  1 +
+ dmenu.c      | 64 +++++++++++++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 59 insertions(+), 6 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb647..65e03fb 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" },
++    [SchemeHp] = { "#bbbbbb", "#333333" }
+ };
+ /* -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 6b8f51b..7bf4099 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -26,14 +26,16 @@
+ #define TEXTW(X)              (drw_fontset_getwidth(drw, (X)) + lrpad)
+ 
+ /* enums */
+-enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
++enum { SchemeNorm, SchemeSel, SchemeHp, SchemeOut, SchemeLast }; /* color schemes */
+ 
+ struct item {
+     char *text;
+     struct item *left, *right;
+-    int out;
++    int out, hp;
+ };
+ 
++static char **hpitems = NULL;
++static int hplength = 0;
+ static char text[BUFSIZ] = "";
+ static char *embed;
+ static int bh, mw, mh;
+@@ -58,6 +60,36 @@ static Clr *scheme[SchemeLast];
+ static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
+ static char *(*fstrstr)(const char *, const char *) = strstr;
+ 
++static char**
++tokenize(char *source, const char *delim, int *llen) {
++    int listlength = 0;
++    char **list = malloc(1 * sizeof(char*));
++    char *token = strtok(source, delim);
++
++    while (token) {
++        if (!(list = realloc(list, sizeof(char*) * (listlength + 1))))
++            die("Unable to realloc %d bytes\n", sizeof(char*) * (listlength + 1));
++        if (!(list[listlength] = strdup(token)))
++            die("Unable to strdup %d bytes\n", strlen(token) + 1);
++        token = strtok(NULL, delim);
++        listlength++;
++    }
++
++    *llen = listlength;
++    return list;
++}
++
++static int
++arrayhas(char **list, int length, char *item) {
++    for (int i = 0; i < length; i++) {
++        int len1 = strlen(list[i]);
++        int len2 = strlen(item);
++        if (fstrncmp(list[i], item, len1 > len2 ? len2 : len1) == 0)
++            return 1;
++    }
++    return 0;
++}
++
+ static void
+ appenditem(struct item *item, struct item **list, struct item **last)
+ {
+@@ -118,6 +150,8 @@ drawitem(struct item *item, int x, int y, int w)
+ {
+     if (item == sel)
+         drw_setscheme(drw, scheme[SchemeSel]);
++    else if (item->hp)
++        drw_setscheme(drw, scheme[SchemeHp]);
+     else if (item->out)
+         drw_setscheme(drw, scheme[SchemeOut]);
+     else
+@@ -219,7 +253,7 @@ match(void)
+     char buf[sizeof text], *s;
+     int i, tokc = 0;
+     size_t len, textsize;
+-    struct item *item, *lprefix, *lsubstr, *prefixend, *substrend;
++    struct item *item, *lhpprefix, *lprefix, *lsubstr, *hpprefixend, *prefixend, *substrend;
+ 
+     strcpy(buf, text);
+     /* separate input text into tokens to be matched individually */
+@@ -228,7 +262,7 @@ match(void)
+             die("cannot realloc %u bytes:", tokn * sizeof *tokv);
+     len = tokc ? strlen(tokv[0]) : 0;
+ 
+-    matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
++    matches = lhpprefix = lprefix = lsubstr = matchend = hpprefixend = prefixend = substrend = NULL;
+     textsize = strlen(text) + 1;
+     for (item = items; item && item->text; item++) {
+         for (i = 0; i < tokc; i++)
+@@ -236,14 +270,24 @@ match(void)
+                 break;
+         if (i != tokc) /* not all tokens match */
+             continue;
+-        /* exact matches go first, then prefixes, then substrings */
++        /* exact matches go first, then prefixes with high priority, then prefixes, then substrings */
+         if (!tokc || !fstrncmp(text, item->text, textsize))
+             appenditem(item, &matches, &matchend);
++        else if (item->hp && !fstrncmp(tokv[0], item->text, len))
++            appenditem(item, &lhpprefix, &hpprefixend);
+         else if (!fstrncmp(tokv[0], item->text, len))
+             appenditem(item, &lprefix, &prefixend);
+         else
+             appenditem(item, &lsubstr, &substrend);
+     }
++    if (lhpprefix) {
++        if (matches) {
++            matchend->right = lhpprefix;
++            lhpprefix->left = matchend;
++        } else
++            matches = lhpprefix;
++        matchend = hpprefixend;
++    }
+     if (lprefix) {
+         if (matches) {
+             matchend->right = lprefix;
+@@ -535,6 +579,7 @@ readstdin(void)
+         if (!(items[i].text = strdup(buf)))
+             die("cannot strdup %u bytes:", strlen(buf) + 1);
+         items[i].out = 0;
++        items[i].hp = arrayhas(hpitems, hplength, items[i].text);
+         drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL);
+         if (tmpmax > inputw) {
+             inputw = tmpmax;
+@@ -683,7 +728,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] [-w windowid]\n"
++          "             [-hb color] [-hf color] [-hp items]\n", stderr);
+     exit(1);
+ }
+ 
+@@ -724,8 +770,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], "-hb"))  /* high priority background color */
++            colors[SchemeHp][ColBg] = argv[++i];
++        else if (!strcmp(argv[i], "-hf")) /* low priority background color */
++            colors[SchemeHp][ColFg] = argv[++i];
+         else if (!strcmp(argv[i], "-w"))   /* embedding window id */
+             embed = argv[++i];
++        else if (!strcmp(argv[i], "-hp"))
++            hpitems = tokenize(argv[++i], ",", &hplength);
+         else
+             usage();
+ 
+-- 
+2.26.2
+
diff --git a/patches/dmenu-lineheight-4.9.diff b/patches/dmenu-lineheight-4.9.diff
@@ -0,0 +1,94 @@
+From 87f92a561c31246f6f9effc0e89ef92677c87746 Mon Sep 17 00:00:00 2001
+From: astier <aleksandrs.stier@uni-bielefeld.de>
+Date: Wed, 27 Feb 2019 21:44:55 +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 |  1 +
+ dmenu.1      |  3 +++
+ dmenu.c      | 10 ++++++++--
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1edb647..317fa2f 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -15,6 +15,7 @@ static const char *colors[SchemeLast][2] = {
+ };
+ /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
+ static unsigned int lines      = 0;
++static unsigned int lineheight = 0;         /* -h option; minimum height of a menu line     */
+ 
+ /*
+  * Characters not considered part of a word while deleting words
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..7ef34d2 100644
+--- a/dmenu.1
++++ b/dmenu.1
+@@ -50,6 +50,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 6b8f51b..45d1946 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) {
+@@ -604,6 +604,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
+@@ -683,6 +684,7 @@ static void
+ usage(void)
+ {
+     fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
++          "             [-h height]\n"
+           "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
+     exit(1);
+ }
+@@ -716,6 +718,10 @@ main(int argc, char *argv[])
+             prompt = argv[++i];
+         else if (!strcmp(argv[i], "-fn"))  /* font or font set */
+             fonts[0] = argv[++i];
++        else if(!strcmp(argv[i], "-h")) { /* minimum height of one menu line */
++            lineheight = atoi(argv[++i]);
++            lineheight = MAX(lineheight,8); /* reasonable default in case of value too small/negative */
++        }
+         else if (!strcmp(argv[i], "-nb"))  /* normal background color */
+             colors[SchemeNorm][ColBg] = argv[++i];
+         else if (!strcmp(argv[i], "-nf"))  /* normal foreground color */
+-- 
+2.21.0
+
diff --git a/patches/dmenu-lineheight-5.0.diff b/patches/dmenu-lineheight-5.0.diff
@@ -0,0 +1,106 @@
+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/patches/dmenu-mousesupport-5.0.diff b/patches/dmenu-mousesupport-5.0.diff
@@ -0,0 +1,144 @@
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..dfa59db 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -500,6 +500,119 @@ draw:
+     drawmenu();
+ }
+ 
++static void
++buttonpress(XEvent *e)
++{
++    struct item *item;
++    XButtonPressedEvent *ev = &e->xbutton;
++    int x = 0, y = 0, h = bh, w;
++
++    if (ev->window != win)
++        return;
++
++    /* right-click: exit */
++    if (ev->button == Button3)
++        exit(1);
++
++    if (prompt && *prompt)
++        x += promptw;
++
++    /* input field */
++    w = (lines > 0 || !matches) ? mw - x : inputw;
++
++    /* left-click on input: clear input,
++     * NOTE: if there is no left-arrow the space for < is reserved so
++     *       add that to the input width */
++    if (ev->button == Button1 &&
++       ((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
++       ((!prev || !curr->left) ? TEXTW("<") : 0)) ||
++       (lines > 0 && ev->y >= y && ev->y <= y + h))) {
++        insert(NULL, -cursor);
++        drawmenu();
++        return;
++    }
++    /* middle-mouse click: paste selection */
++    if (ev->button == Button2) {
++        XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
++                          utf8, utf8, win, CurrentTime);
++        drawmenu();
++        return;
++    }
++    /* scroll up */
++    if (ev->button == Button4 && prev) {
++        sel = curr = prev;
++        calcoffsets();
++        drawmenu();
++        return;
++    }
++    /* scroll down */
++    if (ev->button == Button5 && next) {
++        sel = curr = next;
++        calcoffsets();
++        drawmenu();
++        return;
++    }
++    if (ev->button != Button1)
++        return;
++    if (ev->state & ~ControlMask)
++        return;
++    if (lines > 0) {
++        /* vertical list: (ctrl)left-click on item */
++        w = mw - x;
++        for (item = curr; item != next; item = item->right) {
++            y += h;
++            if (ev->y >= y && ev->y <= (y + h)) {
++                puts(item->text);
++                if (!(ev->state & ControlMask))
++                    exit(0);
++                sel = item;
++                if (sel) {
++                    sel->out = 1;
++                    drawmenu();
++                }
++                return;
++            }
++        }
++    } else if (matches) {
++        /* left-click on left arrow */
++        x += inputw;
++        w = TEXTW("<");
++        if (prev && curr->left) {
++            if (ev->x >= x && ev->x <= x + w) {
++                sel = curr = prev;
++                calcoffsets();
++                drawmenu();
++                return;
++            }
++        }
++        /* horizontal list: (ctrl)left-click on item */
++        for (item = curr; item != next; item = item->right) {
++            x += w;
++            w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
++            if (ev->x >= x && ev->x <= x + w) {
++                puts(item->text);
++                if (!(ev->state & ControlMask))
++                    exit(0);
++                sel = item;
++                if (sel) {
++                    sel->out = 1;
++                    drawmenu();
++                }
++                return;
++            }
++        }
++        /* left-click on right arrow */
++        w = TEXTW(">");
++        x = mw - w;
++        if (next && ev->x >= x && ev->x <= x + w) {
++            sel = curr = next;
++            calcoffsets();
++            drawmenu();
++            return;
++        }
++    }
++}
++
+ static void
+ paste(void)
+ {
+@@ -561,6 +674,9 @@ run(void)
+                 break;
+             cleanup();
+             exit(1);
++        case ButtonPress:
++            buttonpress(&ev);
++            break;
+         case Expose:
+             if (ev.xexpose.count == 0)
+                 drw_map(drw, win, 0, 0, mw, mh);
+@@ -658,7 +774,8 @@ setup(void)
+     /* create menu window */
+     swa.override_redirect = True;
+     swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
+-    swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
++    swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask |
++                     ButtonPressMask;
+     win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
+                         CopyFromParent, CopyFromParent, CopyFromParent,
+                         CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
diff --git a/patches/dmenu-mousesupporthoverbgcol-20210123-1a13d04.diff b/patches/dmenu-mousesupporthoverbgcol-20210123-1a13d04.diff
@@ -0,0 +1,196 @@
+From 51331aed8a535323702b73681c5ce2af6f8f5868 Mon Sep 17 00:00:00 2001
+From: Karol Kosek <krkk@krkk.ct8.pl>
+Date: Sat, 23 Jan 2021 20:16:19 +0100
+Subject: [PATCH] fix mouse hover on vertical lists with prompt text
+
+---
+ dmenu.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 158 insertions(+), 1 deletion(-)
+
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..aff2768 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -500,6 +500,156 @@ draw:
+     drawmenu();
+ }
+ 
++static void
++buttonpress(XEvent *e)
++{
++    struct item *item;
++    XButtonPressedEvent *ev = &e->xbutton;
++    int x = 0, y = 0, h = bh, w;
++
++    if (ev->window != win)
++        return;
++
++    /* right-click: exit */
++    if (ev->button == Button3)
++        exit(1);
++
++    if (prompt && *prompt)
++        x += promptw;
++
++    /* input field */
++    w = (lines > 0 || !matches) ? mw - x : inputw;
++
++    /* left-click on input: clear input,
++     * NOTE: if there is no left-arrow the space for < is reserved so
++     *       add that to the input width */
++    if (ev->button == Button1 &&
++       ((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
++       ((!prev || !curr->left) ? TEXTW("<") : 0)) ||
++       (lines > 0 && ev->y >= y && ev->y <= y + h))) {
++        insert(NULL, -cursor);
++        drawmenu();
++        return;
++    }
++    /* middle-mouse click: paste selection */
++    if (ev->button == Button2) {
++        XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
++                          utf8, utf8, win, CurrentTime);
++        drawmenu();
++        return;
++    }
++    /* scroll up */
++    if (ev->button == Button4 && prev) {
++        sel = curr = prev;
++        calcoffsets();
++        drawmenu();
++        return;
++    }
++    /* scroll down */
++    if (ev->button == Button5 && next) {
++        sel = curr = next;
++        calcoffsets();
++        drawmenu();
++        return;
++    }
++    if (ev->button != Button1)
++        return;
++    /* disabled below, needs to be fixed */
++    /*
++    if (ev->state & ~ControlMask)
++        return;
++    */
++    if (lines > 0) {
++        /* vertical list: (ctrl)left-click on item */
++        w = mw - x;
++        for (item = curr; item != next; item = item->right) {
++            y += h;
++            if (ev->y >= y && ev->y <= (y + h)) {
++                puts(item->text);
++                if (!(ev->state & ControlMask))
++                    exit(0);
++                sel = item;
++                if (sel) {
++                    sel->out = 1;
++                    drawmenu();
++                }
++                return;
++            }
++        }
++    } else if (matches) {
++        /* left-click on left arrow */
++        x += inputw;
++        w = TEXTW("<");
++        if (prev && curr->left) {
++            if (ev->x >= x && ev->x <= x + w) {
++                sel = curr = prev;
++                calcoffsets();
++                drawmenu();
++                return;
++            }
++        }
++        /* horizontal list: (ctrl)left-click on item */
++        for (item = curr; item != next; item = item->right) {
++            x += w;
++            w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
++            if (ev->x >= x && ev->x <= x + w) {
++                puts(item->text);
++                if (!(ev->state & ControlMask))
++                    exit(0);
++                sel = item;
++                if (sel) {
++                    sel->out = 1;
++                    drawmenu();
++                }
++                return;
++            }
++        }
++        /* left-click on right arrow */
++        w = TEXTW(">");
++        x = mw - w;
++        if (next && ev->x >= x && ev->x <= x + w) {
++            sel = curr = next;
++            calcoffsets();
++            drawmenu();
++            return;
++        }
++    }
++}
++
++static void
++mousemove(XEvent *e)
++{
++    struct item *item;
++    XPointerMovedEvent *ev = &e->xmotion;
++    int x = 0, y = 0, h = bh, w;
++
++    if (lines > 0) {
++        w = mw - x;
++        for (item = curr; item != next; item = item->right) {
++            y += h;
++            if (ev->y >= y && ev->y <= (y + h)) {
++                sel = item;
++                calcoffsets();
++                drawmenu();
++                return;
++            }
++        }
++    } else if (matches) {
++        x += inputw + promptw;
++        w = TEXTW("<");
++        for (item = curr; item != next; item = item->right) {
++            x += w;
++            w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
++            if (ev->x >= x && ev->x <= x + w) {
++                sel = item;
++                calcoffsets();
++                drawmenu();
++                return;
++            }
++        }
++    }
++}
++
+ static void
+ paste(void)
+ {
+@@ -561,6 +711,12 @@ run(void)
+                 break;
+             cleanup();
+             exit(1);
++        case ButtonPress:
++            buttonpress(&ev);
++            break;
++        case MotionNotify:
++            mousemove(&ev);
++            break;
+         case Expose:
+             if (ev.xexpose.count == 0)
+                 drw_map(drw, win, 0, 0, mw, mh);
+@@ -658,7 +814,8 @@ setup(void)
+     /* create menu window */
+     swa.override_redirect = True;
+     swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
+-    swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
++    swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask |
++                     ButtonPressMask | PointerMotionMask;
+     win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
+                         CopyFromParent, CopyFromParent, CopyFromParent,
+                         CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
+-- 
+2.30.0
+
diff --git a/patches/dmenu-nosort-5.0.diff b/patches/dmenu-nosort-5.0.diff
@@ -0,0 +1,90 @@
+From 7fbf9575aff62301e17b7f0601080633ae2a8a34 Mon Sep 17 00:00:00 2001
+From: Matt Briancon <matt.briancon@gmail.com>
+Date: Fri, 25 Sep 2020 22:13:38 -0400
+Subject: [PATCH] -S: do not sort matches
+
+---
+ dmenu.1 |  3 +++
+ dmenu.c | 23 ++++++++++++++++-------
+ 2 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..b6af611 100644
+--- a/dmenu.1
++++ b/dmenu.1
+@@ -47,6 +47,9 @@ is faster, but will lock up X until stdin reaches end\-of\-file.
+ .B \-i
+ dmenu matches menu items case insensitively.
+ .TP
++.B \-S
++dmenu does not sort menu items after matching.
++.TP
+ .BI \-l " lines"
+ dmenu lists items vertically, with the given number of lines.
+ .TP
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..efe968c 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -1,6 +1,7 @@
+ /* See LICENSE file for copyright and license details. */
+ #include <ctype.h>
+ #include <locale.h>
++#include <stdbool.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -44,6 +45,7 @@ static struct item *items = NULL;
+ static struct item *matches, *matchend;
+ static struct item *prev, *curr, *next, *sel;
+ static int mon = -1, screen;
++static bool sortmatches = true;
+
+ static Atom clip, utf8;
+ static Display *dpy;
+@@ -236,13 +238,18 @@ match(void)
+                 break;
+         if (i != tokc) /* not all tokens match */
+             continue;
+-        /* exact matches go first, then prefixes, then substrings */
+-        if (!tokc || !fstrncmp(text, item->text, textsize))
++
++        if (!sortmatches)
+             appenditem(item, &matches, &matchend);
+-        else if (!fstrncmp(tokv[0], item->text, len))
+-            appenditem(item, &lprefix, &prefixend);
+-        else
+-            appenditem(item, &lsubstr, &substrend);
++        else {
++            /* exact matches go first, then prefixes, then substrings */
++            if (!tokc || !fstrncmp(text, item->text, textsize))
++                appenditem(item, &matches, &matchend);
++            else if (!fstrncmp(tokv[0], item->text, len))
++                appenditem(item, &lprefix, &prefixend);
++            else
++                appenditem(item, &lsubstr, &substrend);
++        }
+     }
+     if (lprefix) {
+         if (matches) {
+@@ -689,7 +696,7 @@ setup(void)
+ static void
+ usage(void)
+ {
+-    fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
++    fputs("usage: dmenu [-bfivS] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
+           "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
+     exit(1);
+ }
+@@ -709,6 +716,8 @@ 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], "-S"))   /* do not sort matches */
++            sortmatches = false;
+         else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
+             fstrncmp = strncasecmp;
+             fstrstr = cistrstr;
+--
+2.25.1
+
diff --git a/patches/dmenu-numbers-4.9.diff b/patches/dmenu-numbers-4.9.diff
@@ -0,0 +1,81 @@
+From 61abc60dbfaa8ec63fcd176307308aee88a19e32 Mon Sep 17 00:00:00 2001
+From: Miles Alan <m@milesalan.com>
+Date: Sat, 10 Aug 2019 17:20:08 -0500
+Subject: [PATCH] Display number of matched and total items in top right corner
+
+---
+ dmenu.c | 25 +++++++++++++++++++++++--
+ 1 file changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/dmenu.c b/dmenu.c
+index 6b8f51b..98c5810 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -24,6 +24,8 @@
+                              * MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
+ #define LENGTH(X)             (sizeof X / sizeof X[0])
+ #define TEXTW(X)              (drw_fontset_getwidth(drw, (X)) + lrpad)
++#define NUMBERSMAXDIGITS      100
++#define NUMBERSBUFSIZE        (NUMBERSMAXDIGITS * 2) + 1
+ 
+ /* enums */
+ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
+@@ -34,6 +36,7 @@ struct item {
+     int out;
+ };
+ 
++static char numbers[NUMBERSBUFSIZE] = "";
+ static char text[BUFSIZ] = "";
+ static char *embed;
+ static int bh, mw, mh;
+@@ -126,6 +129,21 @@ drawitem(struct item *item, int x, int y, int w)
+     return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0);
+ }
+ 
++static void
++recalculatenumbers()
++{
++    unsigned int numer = 0, denom = 0;
++    struct item *item;
++    if (matchend) {
++        numer++;
++        for (item = matchend; item && item->left; item = item->left)
++            numer++;
++    }
++    for (item = items; item && item->text; item++)
++        denom++;
++    snprintf(numbers, NUMBERSBUFSIZE, "%d/%d", numer, denom);
++}
++
+ static void
+ drawmenu(void)
+ {
+@@ -151,6 +169,7 @@ drawmenu(void)
+         drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
+     }
+ 
++    recalculatenumbers();
+     if (lines > 0) {
+         /* draw vertical list */
+         for (item = curr; item != next; item = item->right)
+@@ -165,13 +184,15 @@ drawmenu(void)
+         }
+         x += w;
+         for (item = curr; item != next; item = item->right)
+-            x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">")));
++            x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">") - TEXTW(numbers)));
+         if (next) {
+             w = TEXTW(">");
+             drw_setscheme(drw, scheme[SchemeNorm]);
+-            drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
++            drw_text(drw, mw - w - TEXTW(numbers), 0, w, bh, lrpad / 2, ">", 0);
+         }
+     }
++    drw_setscheme(drw, scheme[SchemeNorm]);
++    drw_text(drw, mw - TEXTW(numbers), 0, TEXTW(numbers), bh, lrpad / 2, numbers, 0);
+     drw_map(drw, win, 0, 0, mw, mh);
+ }
+ 
+-- 
+2.19.2
+
diff --git a/patches/dmenu-xresources-4.9.diff b/patches/dmenu-xresources-4.9.diff
@@ -0,0 +1,126 @@
+diff '--color=auto' -up ../dmenu-4.9/dmenu.c ./dmenu.c
+--- ../dmenu-4.9/dmenu.c    2019-02-02 13:55:02.000000000 +0100
++++ ./dmenu.c    2020-05-24 00:27:58.038586112 +0200
+@@ -15,6 +15,7 @@
+ #include <X11/extensions/Xinerama.h>
+ #endif
+ #include <X11/Xft/Xft.h>
++#include <X11/Xresource.h>
+
+ #include "drw.h"
+ #include "util.h"
+@@ -53,6 +54,10 @@ static XIC xic;
+ static Drw *drw;
+ static Clr *scheme[SchemeLast];
+
++/* Temporary arrays to allow overriding xresources values */
++static char *colortemp[4];
++static char *tempfonts;
++
+ #include "config.h"
+
+ static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
+@@ -596,8 +601,13 @@ setup(void)
+     int a, di, n, area = 0;
+ #endif
+     /* init appearance */
+-    for (j = 0; j < SchemeLast; j++)
+-        scheme[j] = drw_scm_create(drw, colors[j], 2);
++    for (j = 0; j < SchemeLast; j++) {
++        scheme[j] = drw_scm_create(drw, (const char**)colors[j], 2);
++    }
++    for (j = 0; j < SchemeOut; ++j) {
++        for (i = 0; i < 2; ++i)
++            free(colors[j][i]);
++    }
+
+     clip = XInternAtom(dpy, "CLIPBOARD",   False);
+     utf8 = XInternAtom(dpy, "UTF8_STRING", False);
+@@ -687,6 +697,41 @@ usage(void)
+     exit(1);
+ }
+
++void
++readxresources(void) {
++    XrmInitialize();
++
++    char* xrm;
++    if ((xrm = XResourceManagerString(drw->dpy))) {
++        char *type;
++        XrmDatabase xdb = XrmGetStringDatabase(xrm);
++        XrmValue xval;
++
++        if (XrmGetResource(xdb, "dmenu.font", "*", &type, &xval))
++            fonts[0] = strdup(xval.addr);
++        else
++            fonts[0] = strdup(fonts[0]);
++        if (XrmGetResource(xdb, "dmenu.background", "*", &type, &xval))
++            colors[SchemeNorm][ColBg] = strdup(xval.addr);
++        else
++            colors[SchemeNorm][ColBg] = strdup(colors[SchemeNorm][ColBg]);
++        if (XrmGetResource(xdb, "dmenu.foreground", "*", &type, &xval))
++            colors[SchemeNorm][ColFg] = strdup(xval.addr);
++        else
++            colors[SchemeNorm][ColFg] = strdup(colors[SchemeNorm][ColFg]);
++        if (XrmGetResource(xdb, "dmenu.selbackground", "*", &type, &xval))
++            colors[SchemeSel][ColBg] = strdup(xval.addr);
++        else
++            colors[SchemeSel][ColBg] = strdup(colors[SchemeSel][ColBg]);
++        if (XrmGetResource(xdb, "dmenu.selforeground", "*", &type, &xval))
++            colors[SchemeSel][ColFg] = strdup(xval.addr);
++        else
++            colors[SchemeSel][ColFg] = strdup(colors[SchemeSel][ColFg]);
++
++        XrmDestroyDatabase(xdb);
++    }
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+@@ -715,15 +760,15 @@ main(int argc, char *argv[])
+         else if (!strcmp(argv[i], "-p"))   /* adds prompt to left of input field */
+             prompt = argv[++i];
+         else if (!strcmp(argv[i], "-fn"))  /* font or font set */
+-            fonts[0] = argv[++i];
++            tempfonts = argv[++i];
+         else if (!strcmp(argv[i], "-nb"))  /* normal background color */
+-            colors[SchemeNorm][ColBg] = argv[++i];
++            colortemp[0] = argv[++i];
+         else if (!strcmp(argv[i], "-nf"))  /* normal foreground color */
+-            colors[SchemeNorm][ColFg] = argv[++i];
++            colortemp[1] = argv[++i];
+         else if (!strcmp(argv[i], "-sb"))  /* selected background color */
+-            colors[SchemeSel][ColBg] = argv[++i];
++            colortemp[2] = argv[++i];
+         else if (!strcmp(argv[i], "-sf"))  /* selected foreground color */
+-            colors[SchemeSel][ColFg] = argv[++i];
++            colortemp[3] = argv[++i];
+         else if (!strcmp(argv[i], "-w"))   /* embedding window id */
+             embed = argv[++i];
+         else
+@@ -743,8 +788,23 @@ main(int argc, char *argv[])
+         die("could not get embedding window attributes: 0x%lx",
+             parentwin);
+     drw = drw_create(dpy, screen, root, wa.width, wa.height);
+-    if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
++    readxresources();
++    /* Now we check whether to override xresources with commandline parameters */
++    if ( tempfonts )
++       fonts[0] = strdup(tempfonts);
++    if ( colortemp[0])
++       colors[SchemeNorm][ColBg] = strdup(colortemp[0]);
++    if ( colortemp[1])
++       colors[SchemeNorm][ColFg] = strdup(colortemp[1]);
++    if ( colortemp[2])
++       colors[SchemeSel][ColBg]  = strdup(colortemp[2]);
++    if ( colortemp[3])
++       colors[SchemeSel][ColFg]  = strdup(colortemp[3]);
++
++    if (!drw_fontset_create(drw, (const char**)fonts, LENGTH(fonts)))
+         die("no fonts could be loaded.");
++
++    free(fonts[0]);
+     lrpad = drw->fonts->h;
+
+ #ifdef __OpenBSD__
diff --git a/patches/dmenu-xyw-5.0.diff b/patches/dmenu-xyw-5.0.diff
@@ -0,0 +1,116 @@
+From 7dc7cb96cdda9ad66e33109223c4cc297a7721d1 Mon Sep 17 00:00:00 2001
+From: Alex Cole <ajzcole@airmail.cc>
+Date: Tue, 6 Oct 2020 10:42:07 +1300
+Subject: [PATCH] Updated xyw for 5.0 properly
+
+---
+ dmenu.1 | 24 ++++++++++++++++++++++++
+ dmenu.c | 22 ++++++++++++++++------
+ 2 files changed, 40 insertions(+), 6 deletions(-)
+
+diff --git a/dmenu.1 b/dmenu.1
+index 323f93c..a4ecbbb 100644
+--- a/dmenu.1
++++ b/dmenu.1
+@@ -8,6 +8,12 @@ dmenu \- dynamic menu
+ .IR lines ]
+ .RB [ \-m
+ .IR monitor ]
++.RB [ \-x
++.IR xoffset ]
++.RB [ \-y
++.IR yoffset ]
++.RB [ \-z
++.IR width ]
+ .RB [ \-p
+ .IR prompt ]
+ .RB [ \-fn
+@@ -54,6 +60,24 @@ dmenu lists items vertically, with the given number of lines.
+ dmenu is displayed on the monitor number supplied. Monitor numbers are starting
+ from 0.
+ .TP
++.BI \-x " xoffset"
++dmenu is placed at this offset measured from the left side of the monitor.
++Can be negative.
++If option
++.B \-m
++is present, the measurement will use the given monitor.
++.TP
++.BI \-y " yoffset"
++dmenu is placed at this offset measured from the top of the monitor.  If the
++.B \-b
++option is used, the offset is measured from the bottom.  Can be negative.
++If option
++.B \-m
++is present, the measurement will use the given monitor.
++.TP
++.BI \-z " width"
++sets the width of the dmenu window.
++.TP
+ .BI \-p " prompt"
+ defines the prompt to be displayed to the left of the input field.
+ .TP
+diff --git a/dmenu.c b/dmenu.c
+index 65f25ce..7be19ae 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -37,6 +37,9 @@ struct item {
+ static char text[BUFSIZ] = "";
+ static char *embed;
+ static int bh, mw, mh;
++static int dmx = 0; /* put dmenu at this x offset */
++static int dmy = 0; /* put dmenu at this y offset (measured from the bottom if topbar is 0) */
++static unsigned int dmw = 0; /* make dmenu this wide */
+ static int inputw = 0, promptw;
+ static int lrpad; /* sum of left and right padding */
+ static size_t cursor;
+@@ -637,9 +640,9 @@ setup(void)
+                 if (INTERSECT(x, y, 1, 1, info[i]))
+                     break;
+ 
+-        x = info[i].x_org;
+-        y = info[i].y_org + (topbar ? 0 : info[i].height - mh);
+-        mw = info[i].width;
++        x = info[i].x_org + dmx;
++        y = info[i].y_org + (topbar ? dmy : info[i].height - mh - dmy);
++        mw = (dmw>0 ? dmw : info[i].width);
+         XFree(info);
+     } else
+ #endif
+@@ -647,9 +650,9 @@ setup(void)
+         if (!XGetWindowAttributes(dpy, parentwin, &wa))
+             die("could not get embedding window attributes: 0x%lx",
+                 parentwin);
+-        x = 0;
+-        y = topbar ? 0 : wa.height - mh;
+-        mw = wa.width;
++        x = dmx;
++        y = topbar ? dmy : wa.height - mh - dmy;
++        mw = (dmw>0 ? dmw : wa.width);
+     }
+     promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
+     inputw = MIN(inputw, mw/3);
+@@ -690,6 +693,7 @@ static void
+ usage(void)
+ {
+     fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
++          "             [-x xoffset] [-y yoffset] [-z width]\n"
+           "             [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
+     exit(1);
+ }
+@@ -717,6 +721,12 @@ 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], "-x"))   /* window x offset */
++            dmx = atoi(argv[++i]);
++        else if (!strcmp(argv[i], "-y"))   /* window y offset (from bottom up if -b) */
++            dmy = atoi(argv[++i]);
++        else if (!strcmp(argv[i], "-z"))   /* make dmenu this wide */
++            dmw = atoi(argv[++i]);
+         else if (!strcmp(argv[i], "-m"))
+             mon = atoi(argv[++i]);
+         else if (!strcmp(argv[i], "-p"))   /* adds prompt to left of input field */
+-- 
+2.28.0
+
diff --git a/tags b/tags
@@ -0,0 +1,213 @@
+!_TAG_FILE_FORMAT    2    /extended format; --format=1 will not append ;" to lines/
+!_TAG_FILE_SORTED    1    /0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_OUTPUT_EXCMD    mixed    /number, pattern, mixed, or combineV2/
+!_TAG_OUTPUT_FILESEP    slash    /slash or backslash/
+!_TAG_OUTPUT_MODE    u-ctags    /u-ctags or e-ctags/
+!_TAG_PATTERN_LENGTH_LIMIT    96    /0 for no limit/
+!_TAG_PROC_CWD    /home/mk/.config/dmenu/    //
+!_TAG_PROGRAM_AUTHOR    Universal Ctags Team    //
+!_TAG_PROGRAM_NAME    Universal Ctags    /Derived from Exuberant Ctags/
+!_TAG_PROGRAM_URL    https://ctags.io/    /official site/
+!_TAG_PROGRAM_VERSION    5.9.0    /p5.9.20210905.0/
+$(OBJ)    ./Makefile    /^$(OBJ): arg.h config.h config.mk drw.h$/;"    t
+.c.o    ./Makefile    /^.c.o:$/;"    t
+ARGBEGIN    ./arg.h    /^#define ARGBEGIN    /;"    d
+ARGC    ./arg.h    /^#define ARGC(/;"    d
+ARGEND    ./arg.h    /^#define ARGEND    /;"    d
+ARGF    ./arg.h    /^#define ARGF(/;"    d
+ARG_H__    ./arg.h    /^#define ARG_H__$/;"    d
+BETWEEN    ./util.h    /^#define BETWEEN(/;"    d
+CC    ./config.mk    /^CC = cc$/;"    m
+CFLAGS    ./config.mk    /^CFLAGS   = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)$/;"    m
+CPPFLAGS    ./config.mk    /^CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSI/;"    m
+Clr    ./drw.h    /^typedef XftColor Clr;$/;"    t    typeref:typename:XftColor
+ColBg    ./drw.h    /^enum { ColFg, ColBg }; \/* Clr scheme index *\/$/;"    e    enum:__anon4dab13c50203
+ColFg    ./drw.h    /^enum { ColFg, ColBg }; \/* Clr scheme index *\/$/;"    e    enum:__anon4dab13c50203
+Cur    ./drw.h    /^} Cur;$/;"    t    typeref:struct:__anon4dab13c50108
+DESCRIPTION    ./dmenu.1    /^.SH DESCRIPTION$/;"    s    title:DMENU
+DESCRIPTION    ./stest.1    /^.SH DESCRIPTION$/;"    s    title:STEST
+DMENU    ./dmenu.1    /^.TH DMENU 1 dmenu\\-VERSION$/;"    t
+Drw    ./drw.h    /^} Drw;$/;"    t    typeref:struct:__anon4dab13c50308
+EARGF    ./arg.h    /^#define EARGF(/;"    d
+EXIT    ./stest.1    /^.SH EXIT STATUS$/;"    s    title:STEST
+FLAG    ./stest.c    /^#define FLAG(/;"    d    file:
+FREETYPEINC    ./config.mk    /^FREETYPEINC = \/usr\/include\/freetype2$/;"    m
+FREETYPELIBS    ./config.mk    /^FREETYPELIBS = -lfontconfig -lXft$/;"    m
+Fnt    ./drw.h    /^typedef struct Fnt {$/;"    s
+Fnt    ./drw.h    /^} Fnt;$/;"    t    typeref:struct:Fnt
+INCS    ./config.mk    /^INCS = -I$(X11INC) -I$(FREETYPEINC)$/;"    m
+INTERSECT    ./dmenu.c    /^#define INTERSECT(/;"    d    file:
+LDFLAGS    ./config.mk    /^LDFLAGS  = $(LIBS)$/;"    m
+LENGTH    ./dmenu.c    /^#define LENGTH(/;"    d    file:
+LIBS    ./config.mk    /^LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS)$/;"    m
+MANPREFIX    ./config.mk    /^MANPREFIX = $(PREFIX)\/share\/man$/;"    m
+MAX    ./util.h    /^#define MAX(/;"    d
+MIN    ./util.h    /^#define MIN(/;"    d
+NAME    ./dmenu.1    /^.SH NAME$/;"    s    title:DMENU
+NAME    ./stest.1    /^.SH NAME$/;"    s    title:STEST
+OBJ    ./Makefile    /^OBJ = $(SRC:.c=.o)$/;"    m
+OPTIONS    ./dmenu.1    /^.SH OPTIONS$/;"    s    title:DMENU
+OPTIONS    ./stest.1    /^.SH OPTIONS$/;"    s    title:STEST
+PREFIX    ./config.mk    /^PREFIX = \/usr\/local$/;"    m
+SEE    ./dmenu.1    /^.SH SEE ALSO$/;"    s    title:DMENU
+SEE    ./stest.1    /^.SH SEE ALSO$/;"    s    title:STEST
+SRC    ./Makefile    /^SRC = drw.c dmenu.c stest.c util.c$/;"    m
+STEST    ./stest.1    /^.TH STEST 1 dmenu\\-VERSION$/;"    t
+SYNOPSIS    ./dmenu.1    /^.SH SYNOPSIS$/;"    s    title:DMENU
+SYNOPSIS    ./stest.1    /^.SH SYNOPSIS$/;"    s    title:STEST
+SchemeLast    ./dmenu.c    /^enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; \/* color schemes *\/$/;"    e    enum:__anon57f2eaac0103    file:
+SchemeNorm    ./dmenu.c    /^enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; \/* color schemes *\/$/;"    e    enum:__anon57f2eaac0103    file:
+SchemeOut    ./dmenu.c    /^enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; \/* color schemes *\/$/;"    e    enum:__anon57f2eaac0103    file:
+SchemeSel    ./dmenu.c    /^enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; \/* color schemes *\/$/;"    e    enum:__anon57f2eaac0103    file:
+TEXTW    ./dmenu.c    /^#define TEXTW(/;"    d    file:
+USAGE    ./dmenu.1    /^.SH USAGE$/;"    s    title:DMENU
+UTF_INVALID    ./drw.c    /^#define UTF_INVALID /;"    d    file:
+UTF_SIZ    ./drw.c    /^#define UTF_SIZ /;"    d    file:
+VERSION    ./config.mk    /^VERSION = 5.0$/;"    m
+X11INC    ./config.mk    /^X11INC = \/usr\/X11R6\/include$/;"    m
+X11LIB    ./config.mk    /^X11LIB = \/usr\/X11R6\/lib$/;"    m
+XINERAMAFLAGS    ./config.mk    /^XINERAMAFLAGS = -DXINERAMA$/;"    m
+XINERAMALIBS    ./config.mk    /^XINERAMALIBS  = -lXinerama$/;"    m
+__anon4dab13c50108    ./drw.h    /^typedef struct {$/;"    s
+__anon4dab13c50203    ./drw.h    /^enum { ColFg, ColBg }; \/* Clr scheme index *\/$/;"    g
+__anon4dab13c50308    ./drw.h    /^typedef struct {$/;"    s
+__anon57f2eaac0103    ./dmenu.c    /^enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; \/* color schemes *\/$/;"    g    file:
+all    ./Makefile    /^all: options dmenu stest$/;"    t
+appenditem    ./dmenu.c    /^appenditem(struct item *item, struct item **list, struct item **last)$/;"    f    typeref:typename:void    file:
+argv0    ./stest.c    /^char *argv0;$/;"    v    typeref:typename:char *
+bh    ./dmenu.c    /^static int bh, mw, mh;$/;"    v    typeref:typename:int    file:
+border_width    ./config.def.h    /^static unsigned int border_width = 0;$/;"    v    typeref:typename:unsigned int
+border_width    ./config.h    /^static unsigned int border_width = 0;$/;"    v    typeref:typename:unsigned int
+calcoffsets    ./dmenu.c    /^calcoffsets(void)$/;"    f    typeref:typename:void    file:
+centered    ./config.def.h    /^static int centered = 0;                    \/* -c option; centers dmenu on screen *\/$/;"    v    typeref:typename:int
+centered    ./config.h    /^static int centered = 0;                    \/* -c option; centers dmenu on screen *\/$/;"    v    typeref:typename:int
+cistrstr    ./dmenu.c    /^cistrstr(const char *s, const char *sub)$/;"    f    typeref:typename:char *    file:
+clean    ./Makefile    /^clean:$/;"    t
+cleanup    ./dmenu.c    /^cleanup(void)$/;"    f    typeref:typename:void    file:
+clip    ./dmenu.c    /^static Atom clip, utf8;$/;"    v    typeref:typename:Atom    file:
+colors    ./config.def.h    /^static const char *colors[SchemeLast][2] = {$/;"    v    typeref:typename:const char * [][2]
+colors    ./config.h    /^static const char *colors[SchemeLast][2] = {$/;"    v    typeref:typename:const char * [][2]
+config.h    ./Makefile    /^config.h:$/;"    t
+curr    ./dmenu.c    /^static struct item *prev, *curr, *next, *sel;$/;"    v    typeref:struct:item *    file:
+cursor    ./dmenu.c    /^static size_t cursor;$/;"    v    typeref:typename:size_t    file:
+cursor    ./drw.h    /^    Cursor cursor;$/;"    m    struct:__anon4dab13c50108    typeref:typename:Cursor
+die    ./util.c    /^die(const char *fmt, ...) {$/;"    f    typeref:typename:void
+dist    ./Makefile    /^dist: clean$/;"    t
+dmenu    ./Makefile    /^dmenu: dmenu.o drw.o util.o$/;"    t
+dmw    ./dmenu.c    /^static unsigned int dmw = 0; \/* make dmenu this wide *\/$/;"    v    typeref:typename:unsigned int    file:
+dmx    ./dmenu.c    /^static int dmx = 0; \/* put dmenu at this x offset *\/$/;"    v    typeref:typename:int    file:
+dmy    ./dmenu.c    /^static int dmy = 0; \/* put dmenu at this y offset (measured from the bottom if topbar is 0) *\/$/;"    v    typeref:typename:int    file:
+dpy    ./dmenu.c    /^static Display *dpy;$/;"    v    typeref:typename:Display *    file:
+dpy    ./drw.h    /^    Display *dpy;$/;"    m    struct:Fnt    typeref:typename:Display *
+dpy    ./drw.h    /^    Display *dpy;$/;"    m    struct:__anon4dab13c50308    typeref:typename:Display *
+drawable    ./drw.h    /^    Drawable drawable;$/;"    m    struct:__anon4dab13c50308    typeref:typename:Drawable
+drawitem    ./dmenu.c    /^drawitem(struct item *item, int x, int y, int w)$/;"    f    typeref:typename:int    file:
+drawmenu    ./dmenu.c    /^drawmenu(void)$/;"    f    typeref:typename:void    file:
+drw    ./dmenu.c    /^static Drw *drw;$/;"    v    typeref:typename:Drw *    file:
+drw_clr_create    ./drw.c    /^drw_clr_create(Drw *drw, Clr *dest, const char *clrname)$/;"    f    typeref:typename:void
+drw_create    ./drw.c    /^drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)$/;"    f    typeref:typename:Drw *
+drw_cur_create    ./drw.c    /^drw_cur_create(Drw *drw, int shape)$/;"    f    typeref:typename:Cur *
+drw_cur_free    ./drw.c    /^drw_cur_free(Drw *drw, Cur *cursor)$/;"    f    typeref:typename:void
+drw_font_getexts    ./drw.c    /^drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h/;"    f    typeref:typename:void
+drw_fontset_create    ./drw.c    /^drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)$/;"    f    typeref:typename:Fnt *
+drw_fontset_free    ./drw.c    /^drw_fontset_free(Fnt *font)$/;"    f    typeref:typename:void
+drw_fontset_getwidth    ./drw.c    /^drw_fontset_getwidth(Drw *drw, const char *text)$/;"    f    typeref:typename:unsigned int
+drw_free    ./drw.c    /^drw_free(Drw *drw)$/;"    f    typeref:typename:void
+drw_map    ./drw.c    /^drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)$/;"    f    typeref:typename:void
+drw_rect    ./drw.c    /^drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert)$/;"    f    typeref:typename:void
+drw_resize    ./drw.c    /^drw_resize(Drw *drw, unsigned int w, unsigned int h)$/;"    f    typeref:typename:void
+drw_scm_create    ./drw.c    /^drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)$/;"    f    typeref:typename:Clr *
+drw_setfontset    ./drw.c    /^drw_setfontset(Drw *drw, Fnt *set)$/;"    f    typeref:typename:void
+drw_setscheme    ./drw.c    /^drw_setscheme(Drw *drw, Clr *scm)$/;"    f    typeref:typename:void
+drw_text    ./drw.c    /^drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char */;"    f    typeref:typename:int
+ecalloc    ./util.c    /^ecalloc(size_t nmemb, size_t size)$/;"    f    typeref:typename:void *
+embed    ./dmenu.c    /^static char *embed;$/;"    v    typeref:typename:char *    file:
+flag    ./stest.c    /^static int flag[26];$/;"    v    typeref:typename:int[26]    file:
+fonts    ./config.def.h    /^static const char *fonts[] = {$/;"    v    typeref:typename:const char * []
+fonts    ./config.h    /^static const char *fonts[] = {$/;"    v    typeref:typename:const char * []
+fonts    ./drw.h    /^    Fnt *fonts;$/;"    m    struct:__anon4dab13c50308    typeref:typename:Fnt *
+fstrncmp    ./dmenu.c    /^static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;$/;"    v    typeref:typename:int (*)(const char *,const char *,size_t)    file:
+fstrstr    ./dmenu.c    /^static char *(*fstrstr)(const char *, const char *) = strstr;$/;"    v    typeref:typename:char * (*)(const char *,const char *)    file:
+gc    ./drw.h    /^    GC gc;$/;"    m    struct:__anon4dab13c50308    typeref:typename:GC
+grabfocus    ./dmenu.c    /^grabfocus(void)$/;"    f    typeref:typename:void    file:
+grabkeyboard    ./dmenu.c    /^grabkeyboard(void)$/;"    f    typeref:typename:void    file:
+h    ./drw.h    /^    unsigned int h;$/;"    m    struct:Fnt    typeref:typename:unsigned int
+h    ./drw.h    /^    unsigned int w, h;$/;"    m    struct:__anon4dab13c50308    typeref:typename:unsigned int
+inputw    ./dmenu.c    /^static int inputw = 0, promptw;$/;"    v    typeref:typename:int    file:
+insert    ./dmenu.c    /^insert(const char *str, ssize_t n)$/;"    f    typeref:typename:void    file:
+install    ./Makefile    /^install: all$/;"    t
+item    ./dmenu.c    /^struct item {$/;"    s    file:
+items    ./dmenu.c    /^static struct item *items = NULL;$/;"    v    typeref:struct:item *    file:
+keypress    ./dmenu.c    /^keypress(XKeyEvent *ev)$/;"    f    typeref:typename:void    file:
+left    ./dmenu.c    /^    struct item *left, *right;$/;"    m    struct:item    typeref:struct:item *    file:
+lineheight    ./config.def.h    /^static unsigned int lineheight = 0;$/;"    v    typeref:typename:unsigned int
+lineheight    ./config.h    /^static unsigned int lineheight = 0;$/;"    v    typeref:typename:unsigned int
+lines    ./config.def.h    /^static unsigned int lines      = 0;$/;"    v    typeref:typename:unsigned int
+lines    ./config.h    /^static unsigned int lines      = 0;$/;"    v    typeref:typename:unsigned int
+lrpad    ./dmenu.c    /^static int lrpad; \/* sum of left and right padding *\/$/;"    v    typeref:typename:int    file:
+main    ./dmenu.c    /^main(int argc, char *argv[])$/;"    f    typeref:typename:int
+main    ./stest.c    /^main(int argc, char *argv[])$/;"    f    typeref:typename:int
+match    ./dmenu.c    /^match(void)$/;"    f    typeref:typename:void    file:
+match    ./stest.c    /^static int match = 0;$/;"    v    typeref:typename:int    file:
+matchend    ./dmenu.c    /^static struct item *matches, *matchend;$/;"    v    typeref:struct:item *    file:
+matches    ./dmenu.c    /^static struct item *matches, *matchend;$/;"    v    typeref:struct:item *    file:
+max_textw    ./dmenu.c    /^max_textw(void)$/;"    f    typeref:typename:int    file:
+mh    ./dmenu.c    /^static int bh, mw, mh;$/;"    v    typeref:typename:int    file:
+min_lineheight    ./config.def.h    /^static unsigned int min_lineheight = 8;$/;"    v    typeref:typename:unsigned int
+min_lineheight    ./config.h    /^static unsigned int min_lineheight = 8;$/;"    v    typeref:typename:unsigned int
+min_width    ./config.def.h    /^static int min_width = -200;                    \/* minimum width when centered *\/$/;"    v    typeref:typename:int
+min_width    ./config.h    /^static int min_width = -200;                    \/* minimum width when centered *\/$/;"    v    typeref:typename:int
+mon    ./dmenu.c    /^static int mon = -1, screen;$/;"    v    typeref:typename:int    file:
+movewordedge    ./dmenu.c    /^movewordedge(int dir)$/;"    f    typeref:typename:void    file:
+mw    ./dmenu.c    /^static int bh, mw, mh;$/;"    v    typeref:typename:int    file:
+new    ./stest.c    /^static struct stat old, new;$/;"    v    typeref:struct:stat    file:
+next    ./dmenu.c    /^static struct item *prev, *curr, *next, *sel;$/;"    v    typeref:struct:item *    file:
+next    ./drw.h    /^    struct Fnt *next;$/;"    m    struct:Fnt    typeref:struct:Fnt *
+nextrune    ./dmenu.c    /^nextrune(int inc)$/;"    f    typeref:typename:size_t    file:
+old    ./stest.c    /^static struct stat old, new;$/;"    v    typeref:struct:stat    file:
+options    ./Makefile    /^options:$/;"    t
+out    ./dmenu.c    /^    int out;$/;"    m    struct:item    typeref:typename:int    file:
+parentwin    ./dmenu.c    /^static Window root, parentwin, win;$/;"    v    typeref:typename:Window    file:
+paste    ./dmenu.c    /^paste(void)$/;"    f    typeref:typename:void    file:
+pattern    ./drw.h    /^    FcPattern *pattern;$/;"    m    struct:Fnt    typeref:typename:FcPattern *
+prev    ./dmenu.c    /^static struct item *prev, *curr, *next, *sel;$/;"    v    typeref:struct:item *    file:
+prompt    ./config.def.h    /^static const char *prompt      = NULL;      \/* -p  option; prompt to the left of input field *\/$/;"    v    typeref:typename:const char *
+prompt    ./config.h    /^static const char *prompt      = NULL;      \/* -p  option; prompt to the left of input field *\/$/;"    v    typeref:typename:const char *
+promptw    ./dmenu.c    /^static int inputw = 0, promptw;$/;"    v    typeref:typename:int    file:
+readstdin    ./dmenu.c    /^readstdin(void)$/;"    f    typeref:typename:void    file:
+right    ./dmenu.c    /^    struct item *left, *right;$/;"    m    struct:item    typeref:struct:item *    file:
+root    ./dmenu.c    /^static Window root, parentwin, win;$/;"    v    typeref:typename:Window    file:
+root    ./drw.h    /^    Window root;$/;"    m    struct:__anon4dab13c50308    typeref:typename:Window
+run    ./dmenu.c    /^run(void)$/;"    f    typeref:typename:void    file:
+scheme    ./dmenu.c    /^static Clr *scheme[SchemeLast];$/;"    v    typeref:typename:Clr * []    file:
+scheme    ./drw.h    /^    Clr *scheme;$/;"    m    struct:__anon4dab13c50308    typeref:typename:Clr *
+screen    ./dmenu.c    /^static int mon = -1, screen;$/;"    v    typeref:typename:int    file:
+screen    ./drw.h    /^    int screen;$/;"    m    struct:__anon4dab13c50308    typeref:typename:int
+sel    ./dmenu.c    /^static struct item *prev, *curr, *next, *sel;$/;"    v    typeref:struct:item *    file:
+setup    ./dmenu.c    /^setup(void)$/;"    f    typeref:typename:void    file:
+sortmatches    ./dmenu.c    /^static bool sortmatches = true;$/;"    v    typeref:typename:bool    file:
+stest    ./Makefile    /^stest: stest.o$/;"    t
+test    ./stest.c    /^test(const char *path, const char *name)$/;"    f    typeref:typename:void    file:
+text    ./dmenu.c    /^    char *text;$/;"    m    struct:item    typeref:typename:char *    file:
+text    ./dmenu.c    /^static char text[BUFSIZ] = "";$/;"    v    typeref:typename:char[]    file:
+topbar    ./config.def.h    /^static int topbar = 1;                      \/* -b  option; if 0, dmenu appears at bottom     *\/$/;"    v    typeref:typename:int
+topbar    ./config.h    /^static int topbar = 1;                      \/* -b  option; if 0, dmenu appears at bottom     *\/$/;"    v    typeref:typename:int
+uninstall    ./Makefile    /^uninstall:$/;"    t
+usage    ./dmenu.c    /^usage(void)$/;"    f    typeref:typename:void    file:
+usage    ./stest.c    /^usage(void)$/;"    f    typeref:typename:void    file:
+utf8    ./dmenu.c    /^static Atom clip, utf8;$/;"    v    typeref:typename:Atom    file:
+utf8decode    ./drw.c    /^utf8decode(const char *c, long *u, size_t clen)$/;"    f    typeref:typename:size_t    file:
+utf8decodebyte    ./drw.c    /^utf8decodebyte(const char c, size_t *i)$/;"    f    typeref:typename:long    file:
+utf8validate    ./drw.c    /^utf8validate(long *u, size_t i)$/;"    f    typeref:typename:size_t    file:
+utfbyte    ./drw.c    /^static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80,    0, 0xC0, 0xE0, 0xF0};$/;"    v    typeref:typename:const unsigned char[]    file:
+utfmask    ./drw.c    /^static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};$/;"    v    typeref:typename:const unsigned char[]    file:
+utfmax    ./drw.c    /^static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};$/;"    v    typeref:typename:const long[]    file:
+utfmin    ./drw.c    /^static const long utfmin[UTF_SIZ + 1] = {       0,    0,  0x80,  0x800,  0x10000};$/;"    v    typeref:typename:const long[]    file:
+w    ./drw.h    /^    unsigned int w, h;$/;"    m    struct:__anon4dab13c50308    typeref:typename:unsigned int
+win    ./dmenu.c    /^static Window root, parentwin, win;$/;"    v    typeref:typename:Window    file:
+worddelimiters    ./config.def.h    /^static const char worddelimiters[] = " ";$/;"    v    typeref:typename:const char[]
+worddelimiters    ./config.h    /^static const char worddelimiters[] = " ";$/;"    v    typeref:typename:const char[]
+xfont    ./drw.h    /^    XftFont *xfont;$/;"    m    struct:Fnt    typeref:typename:XftFont *
+xfont_create    ./drw.c    /^xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)$/;"    f    typeref:typename:Fnt *    file:
+xfont_free    ./drw.c    /^xfont_free(Fnt *font)$/;"    f    typeref:typename:void    file:
+xic    ./dmenu.c    /^static XIC xic;$/;"    v    typeref:typename:XIC    file: