commit b9cf733b51f2b9d45353bc6b8cab5cbe6e80bc7a
parent 5cd49bb6b63da32f005c95ac669c93ce1ca16b6b
Author: PratikBhusal <PratikBhusal@users.noreply.github.com>
Date: Fri, 20 Dec 2019 14:00:06 -0600
[dmenu][patch][xresources][bugfix] keep explicit command line arguments
In the previous iteration of the patch, it would override any command
line arguments given to dmenu. This commit fixes that by moving the
read_Xresources function to just before the arguments are read.
Diffstat:
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff b/tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff
@@ -1,6 +1,6 @@
-From ed9359221c52f239d887b6ee4de152428316dd73 Mon Sep 17 00:00:00 2001
+From 5bd3be185cb9730ff49b72dc60dc8c18ae231ae3 Mon Sep 17 00:00:00 2001
From: PratikBhusal <PratikBhusal@users.noreply.github.com>
-Date: Sat, 14 Dec 2019 19:53:28 -0600
+Date: Fri, 20 Dec 2019 13:51:17 -0600
Subject: [PATCH] Extract Xresources patch by @melek to dmenu
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@@ -18,12 +18,16 @@ dmenu.background : normal background color
dmenu.foreground : normal foreground color
dmenu.selbackground : selected background color
dmenu.selforeground : selected foreground color
+
+Note: Just like how it is in config.h, this patch only changes the
+default font and colors. If you wish to explicitly change the values via
+command line arguements, see "man dmenu" for more details.
---
dmenu.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/dmenu.c b/dmenu.c
-index 6b8f51b..3373abe 100644
+index 6b8f51b..8606dee 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -15,6 +15,7 @@
@@ -34,7 +38,7 @@ index 6b8f51b..3373abe 100644
#include "drw.h"
#include "util.h"
-@@ -687,6 +688,31 @@ usage(void)
+@@ -687,12 +688,38 @@ usage(void)
exit(1);
}
@@ -66,14 +70,13 @@ index 6b8f51b..3373abe 100644
int
main(int argc, char *argv[])
{
-@@ -743,6 +769,7 @@ 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);
+ XWindowAttributes wa;
+ int i, fast = 0;
+
+ read_Xresources();
- if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
- die("no fonts could be loaded.");
- lrpad = drw->fonts->h;
+ for (i = 1; i < argc; i++)
+ /* these options take no arguments */
+ if (!strcmp(argv[i], "-v")) { /* prints version information */
--
2.24.1
diff --git a/tools.suckless.org/dmenu/patches/xresources/index.md b/tools.suckless.org/dmenu/patches/xresources/index.md
@@ -16,6 +16,10 @@ that can be changed and what they change:
- dmenu.selbackground : selected background color
- dmenu.selforeground : selected foreground color
+Note: Just like how it is in config.h, this patch only changes the default font
+and colors. If you wish to explicitly change the values via
+command line arguements, see "man dmenu" for more details.
+
Download
--------
* [dmenu-xresources-4.9.diff](dmenu-xresources-4.9.diff)