[wiki] [sites] Final polished version of the patch. || Vadim Zyamalov

From: <git_AT_suckless.org>
Date: Fri, 16 Apr 2021 05:40:53 +0200

commit 3027f4b94cfdd5e0d8b1267c3e5a607856429d74
Author: Vadim Zyamalov <zyamalov.ve_AT_gmail.com>
Date: Fri Apr 16 06:40:12 2021 +0300

    Final polished version of the patch.
    
    Non-crucial changes allowing for "patch-n-go" usage.

diff --git a/tools.suckless.org/dmenu/patches/xresources-alt/dmenu-xresources-alt-5.0.diff b/tools.suckless.org/dmenu/patches/xresources-alt/dmenu-xresources-alt-5.0.diff
index a3459556..f7f052f0 100644
--- a/tools.suckless.org/dmenu/patches/xresources-alt/dmenu-xresources-alt-5.0.diff
+++ b/tools.suckless.org/dmenu/patches/xresources-alt/dmenu-xresources-alt-5.0.diff
_AT_@ -1,18 +1,20 @@
 diff -rupN orig/config.def.h patched/config.def.h
---- orig/config.def.h 2020-09-02 22:37:08.000000000 +0300
-+++ patched/config.def.h 2021-04-15 09:50:54.729040042 +0300
-_AT_@ -2,16 +2,22 @@
+--- orig/config.def.h 2021-04-16 06:30:47.713924755 +0300
++++ patched/config.def.h 2021-04-16 06:34:14.956933252 +0300
+_AT_@ -2,16 +2,25 @@
  /* Default settings; can be overriden by command line. */
  
  static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
 +
  /* -fn option overrides fonts[0]; default X11 font or font set */
--static const char *fonts[] = {
++static char font[] = "monospace:size=10";
+ static const char *fonts[] = {
 - "monospace:size=10"
--};
++ font,
++ "monospace:size=10",
+ };
 -static const char *prompt = NULL; /* -p option; prompt to the left of input field */
-+static char font[] = "monospace:size=10";
-+static const char *fonts[] = { font };
+-static const char *colors[SchemeLast][2] = {
 +
 +static char *prompt = NULL; /* -p option; prompt to the left of input field */
 +
_AT_@ -20,7 +22,7 @@ diff -rupN orig/config.def.h patched/config.def.h
 +static char normbgcolor[] = "#222222";
 +static char selfgcolor[] = "#eeeeee";
 +static char selbgcolor[] = "#005577";
- static const char *colors[SchemeLast][2] = {
++static char *colors[SchemeLast][2] = {
          /* fg bg */
 - [SchemeNorm] = { "#bbbbbb", "#222222" },
 - [SchemeSel] = { "#eeeeee", "#005577" },
_AT_@ -31,7 +33,7 @@ diff -rupN orig/config.def.h patched/config.def.h
  };
  /* -l option; if nonzero, dmenu uses vertical list with given number of lines */
  static unsigned int lines = 0;
-_AT_@ -21,3 +27,14 @@ static unsigned int lines = 0;
+_AT_@ -21,3 +30,15 @@ static unsigned int lines = 0;
   * for example: " /?\"&[]"
   */
  static const char worddelimiters[] = " ";
_AT_@ -40,6 +42,7 @@ diff -rupN orig/config.def.h patched/config.def.h
 + * Xresources preferences to load at startup
 + */
 +ResourcePref resources[] = {
++ { "font", STRING, &font },
 + { "normfgcolor", STRING, &normfgcolor },
 + { "normbgcolor", STRING, &normbgcolor },
 + { "selfgcolor", STRING, &selfgcolor },
_AT_@ -47,8 +50,8 @@ diff -rupN orig/config.def.h patched/config.def.h
 + { "prompt", STRING, &prompt },
 +};
 diff -rupN orig/dmenu.c patched/dmenu.c
---- orig/dmenu.c 2020-09-02 22:37:08.000000000 +0300
-+++ patched/dmenu.c 2021-04-15 12:43:38.000000000 +0300
+--- orig/dmenu.c 2021-04-16 06:30:47.715924755 +0300
++++ patched/dmenu.c 2021-04-16 06:30:59.668925245 +0300
 _AT_@ -11,6 +11,7 @@
  #include <X11/Xlib.h>
  #include <X11/Xatom.h>
_AT_@ -154,8 +157,8 @@ diff -rupN orig/dmenu.c patched/dmenu.c
                  /* these options take no arguments */
                  if (!strcmp(argv[i], "-v")) { /* prints version information */
 diff -rupN orig/drw.c patched/drw.c
---- orig/drw.c 2020-09-02 22:37:08.000000000 +0300
-+++ patched/drw.c 2021-04-15 11:00:18.000000000 +0300
+--- orig/drw.c 2021-04-16 06:30:47.718924755 +0300
++++ patched/drw.c 2021-04-16 06:30:59.670925245 +0300
 _AT_@ -208,7 +208,7 @@ drw_clr_create(Drw *drw, Clr *dest, cons
  /* Wrapper to create color schemes. The caller has to call free(3) on the
   * returned color scheme when done using it. */
_AT_@ -166,8 +169,8 @@ diff -rupN orig/drw.c patched/drw.c
          size_t i;
          Clr *ret;
 diff -rupN orig/drw.h patched/drw.h
---- orig/drw.h 2020-09-02 22:37:08.000000000 +0300
-+++ patched/drw.h 2021-04-15 11:01:06.000000000 +0300
+--- orig/drw.h 2021-04-16 06:30:47.718924755 +0300
++++ patched/drw.h 2021-04-16 06:30:59.671925245 +0300
 _AT_@ -39,7 +39,7 @@ void drw_font_getexts(Fnt *font, const c
  
  /* Colorscheme abstraction */
diff --git a/tools.suckless.org/dmenu/patches/xresources-alt/index.md b/tools.suckless.org/dmenu/patches/xresources-alt/index.md
index 1ea3065b..a1901122 100644
--- a/tools.suckless.org/dmenu/patches/xresources-alt/index.md
+++ b/tools.suckless.org/dmenu/patches/xresources-alt/index.md
_AT_@ -6,7 +6,8 @@ Description
 This patch is actually a xresources patch for dwm, applied to dmenu.
 
 The patch add the ability to configure dmenu via Xresources by using arbitrary
-resources, not specific ones.
+resources, not specific ones. Xresources values override default settings and can be
+overriden by command line arguments.
 
 All thanks should go to the authors of xresources patch for dwm, xresources and
 xrdb patches for st.
Received on Fri Apr 16 2021 - 05:40:53 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 16 2021 - 05:48:52 CEST