[wiki] [sites] Revert "[dmenu][patch][date] Add patch" || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Thu, 06 Jul 2023 09:39:21 +0200

commit ecb575e12addf7f8f772ba9a30d44bd50f8e555a
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Thu Jul 6 09:43:14 2023 +0200

    Revert "[dmenu][patch][date] Add patch"
    
    This reverts commit c36407806f49de7cb01e1911a1e069eb2a75642a.
    
    Comments:
    - Leaks memory for output variable.
    - You can use strftime and time(NULL) to show the current date.

diff --git a/tools.suckless.org/dmenu/patches/date/dmenu-date-5.2.diff b/tools.suckless.org/dmenu/patches/date/dmenu-date-5.2.diff
deleted file mode 100644
index d865025d..00000000
--- a/tools.suckless.org/dmenu/patches/date/dmenu-date-5.2.diff
+++ /dev/null
_AT_@ -1,62 +0,0 @@
-From a73aeae977ad0ccfc7656175ef8900de41f97bd8 Mon Sep 17 00:00:00 2001
-From: piotr-marendowski <piotr-marendowski_AT_tutanota.com>
-Date: Wed, 5 Jul 2023 13:05:37 +0000
-Subject: [PATCH] Displays date and time at the bottom of the vertical dmenu
- layout.
-
----
- 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