[wiki] [sites] [dmenu][patch][xresources][bugfix] keep explicit command line arguments || PratikBhusal

From: <git_AT_suckless.org>
Date: Fri, 20 Dec 2019 21:04:30 +0100

commit b9cf733b51f2b9d45353bc6b8cab5cbe6e80bc7a
Author: PratikBhusal <PratikBhusal_AT_users.noreply.github.com>
Date: Fri Dec 20 14:00:06 2019 -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.

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
index 4090a380..943fdc68 100644
--- a/tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff
+++ b/tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff
_AT_@ -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_AT_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 _AT_melek to dmenu
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
_AT_@ -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
 _AT_@ -15,6 +15,7 @@
_AT_@ -34,7 +38,7 @@ index 6b8f51b..3373abe 100644
  
  #include "drw.h"
  #include "util.h"
-_AT_@ -687,6 +688,31 @@ usage(void)
+_AT_@ -687,12 +688,38 @@ usage(void)
          exit(1);
  }
  
_AT_@ -66,14 +70,13 @@ index 6b8f51b..3373abe 100644
  int
  main(int argc, char *argv[])
  {
-_AT_@ -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
index eface9d5..87bd1842 100644
--- a/tools.suckless.org/dmenu/patches/xresources/index.md
+++ b/tools.suckless.org/dmenu/patches/xresources/index.md
_AT_@ -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)
Received on Fri Dec 20 2019 - 21:04:30 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 20 2019 - 21:12:39 CET