[wiki] [sites] This commit is to add the patch dmenu/patches/no-default-select/. I have written everything regarding it in the patch's index.md file. || vishal

From: <git_AT_suckless.org>
Date: Sat, 06 Jan 2024 07:50:12 +0100

commit f9cf6541ad9b8951f5aa22b311114f12807ffcad
Author: vishal <vishal340_AT_github.com>
Date: Sat Jan 6 12:16:46 2024 +0530

    This commit is to add the patch dmenu/patches/no-default-select/.
    I have written everything regarding it in the patch's index.md file.

diff --git a/tools.suckless.org/dmenu/patches/no-default-select/dmenu-nodefaultsel-20240105-9a6ef61.diff b/tools.suckless.org/dmenu/patches/no-default-select/dmenu-nodefaultsel-20240105-9a6ef61.diff
new file mode 100644
index 00000000..bba2b302
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/no-default-select/dmenu-nodefaultsel-20240105-9a6ef61.diff
_AT_@ -0,0 +1,69 @@
+From 9a6ef6174ade2913e940d453f81c488b47d365fa Mon Sep 17 00:00:00 2001
+From: vishal <vishal340_AT_github.com>
+Date: Fri, 5 Jan 2024 16:54:19 +0530
+Subject: [PATCH] With this patch dmenu will no longer select the first item by
+ default and you can use right and left key for bothmoving in text and drop
+ down. dependencies: grid and gridnav
+
+---
+ dmenu.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/dmenu.c b/dmenu.c
+index 1a76e1b..050073b 100644
+--- a/dmenu.c
++++ b/dmenu.c
+_AT_@ -282,7 +282,7 @@ match(void)
+ matches = lsubstr;
+ matchend = substrend;
+ }
+- curr = sel = matches;
++ curr = matches;
+ calcoffsets();
+ }
+
+_AT_@ -467,8 +467,10 @@ insert:
+ break;
+ case XK_Left:
+ if (columns > 1) {
+- if (!sel)
++ if (!sel){
++ system("xdotool key KP_Left");
+ return;
++ }
+ tmpsel = sel;
+ for (i = 0; i < lines; i++) {
+ if (!tmpsel->left || tmpsel->left->right != tmpsel) {
+_AT_@ -501,6 +503,8 @@ insert:
+ curr = prev;
+ calcoffsets();
+ }
++ else if (sel && !sel->left)
++ sel = NULL;
+ break;
+ case XK_Next:
+ case XK_KP_Next:
+_AT_@ -528,8 +532,10 @@ insert:
+ break;
+ case XK_Right:
+ if (columns > 1) {
+- if (!sel)
++ if (!sel) {
++ system("xdotool key KP_Right");
+ return;
++ }
+ tmpsel = sel;
+ for (i = 0; i < lines; i++) {
+ if (!tmpsel->right || tmpsel->right->left != tmpsel) {
+_AT_@ -562,6 +568,8 @@ insert:
+ curr = next;
+ calcoffsets();
+ }
++ else if (!sel && curr)
++ sel = curr;
+ break;
+ case XK_Tab:
+ if (!sel)
+--
+2.43.0
+
diff --git a/tools.suckless.org/dmenu/patches/no-default-select/index.md b/tools.suckless.org/dmenu/patches/no-default-select/index.md
new file mode 100644
index 00000000..5b2dfddd
--- /dev/null
+++ b/tools.suckless.org/dmenu/patches/no-default-select/index.md
_AT_@ -0,0 +1,16 @@
+no-default-select
+=================
+This patch changes how the default selection works. It depends on [gridnav](../gridnav).
+
+By default, dmenu selects the first entry.
+I like the [gridnav](../gridnav) patch which along with [grid](../grid) lets you see the results in a grid and use right and left arrow to move around in dropdown. But you lose the ability to move in typed text because the default selection feature of dmenu.
+
+This patch fixes it by not selecting anything by default. So, now one can move in text and in dropdown.
+
+Download
+--------
+* [dmenu-nodefaultsel-5.2.diff](dmenu-nodefaultsel-20240105-9a6ef61.diff)
+
+Author
+------
+* Vishal Tripathy <vishaltripathy54_AT_gmail.com>
Received on Sat Jan 06 2024 - 07:50:12 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 06 2024 - 08:00:47 CET