sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 3027f4b94cfdd5e0d8b1267c3e5a607856429d74
parent ea8dfa1af2fe490f8ce04bc05f3ce38fbb0f7139
Author: Vadim Zyamalov <zyamalov.ve@gmail.com>
Date:   Fri, 16 Apr 2021 06:40:12 +0300

Final polished version of the patch.

Non-crucial changes allowing for "patch-n-go" usage.

Diffstat:
Mtools.suckless.org/dmenu/patches/xresources-alt/dmenu-xresources-alt-5.0.diff | 33++++++++++++++++++---------------
Mtools.suckless.org/dmenu/patches/xresources-alt/index.md | 3++-
2 files changed, 20 insertions(+), 16 deletions(-)

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 @@ -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 -@@ -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 +@@ -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 */ + @@ -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" }, @@ -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; -@@ -21,3 +27,14 @@ static unsigned int lines = 0; +@@ -21,3 +30,15 @@ static unsigned int lines = 0; * for example: " /?\"&[]" */ static const char worddelimiters[] = " "; @@ -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 }, @@ -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 @@ -11,6 +11,7 @@ #include <X11/Xlib.h> #include <X11/Xatom.h> @@ -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 @@ -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. */ @@ -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 @@ -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 @@ -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.