---- - dmenu.c | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) - -diff --git a/dmenu.c b/dmenu.c -index 7cf253b..b7c35ce 100644 ---- a/dmenu.c -+++ b/dmenu.c -_AT_@ -84,7 +84,7 @@ calcoffsets(void) - int i, n; - - if (lines > 0) -- n = lines * bh; -+ n = (lines * bh) - 1; - else - n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); - /* calculate which items will begin the next page and previous page */ -_AT_@ -143,6 +143,26 @@ drawitem(struct item *item, int x, int y, int w) - return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0); - } - -+static int -+drawdate(int x, int y, int w) -+{ -+ FILE *fp; -+ char buffer[128], *output; -+ -+ /* use date command +arugments (without space!)*/ -+ fp = popen("date +'%H:%M %A %d %B %Y'", "r"); -+ fgets(buffer, sizeof(buffer), fp); -+ pclose(fp); -+ -+ output = strdup(buffer); -+ output[strlen(output) - 1] = '-+ -+ drw_setscheme(drw, scheme[SchemeSel]); -+ -+ int r = drw_text(drw, x, y, w, bh, lrpad / 2, output, 0); -+ return r; -+} -+ - static void - drawmenu(void) - { -_AT_@ -172,6 +192,8 @@ drawmenu(void) - /* draw vertical list */ - for (item = curr; item != next; item = item->right) - drawitem(item, x, y += bh, mw - x); -+ -+ drawdate(x, lines * bh, w); - } else if (matches) { - /* draw horizontal list */ - x += inputw; --- -2.41.0 - diff --git a/tools.suckless.org/dmenu/patches/date/dmenu-date.png b/tools.suckless.org/dmenu/patches/date/dmenu-date.png deleted file mode 100644 index 28e75031..00000000 Binary files a/tools.suckless.org/dmenu/patches/date/dmenu-date.png and /dev/null differ diff --git a/tools.suckless.org/dmenu/patches/date/index.md b/tools.suckless.org/dmenu/patches/date/index.md deleted file mode 100644 index 58e09ddb..00000000 --- a/tools.suckless.org/dmenu/patches/date/index.md +++ /dev/null _AT_@ -1,16 +0,0 @@ -date -============= - -Description ------------ -This patch adds date and time at the bottom of the vertical dmenu layout, using the `date` command with arguments. - -![dmenu date screenshot](dmenu-date.png) - -Download --------- -[dmenu-date-5.2.diff](dmenu-date-5.2.diff) (2023-07-05) - -Authors -------- -* Piotr Marendowski <piotr-marendowski_AT_tutanota.com>Received on Thu Jul 06 2023 - 09:39:21 CEST
This archive was generated by hypermail 2.3.0 : Thu Jul 06 2023 - 09:48:52 CEST