From 0fade9158a9d203f3a7077922ec5ede7bb0b805c Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 7 May 2021 09:27:05 +0200 Subject: [PATCH] xresources reload: minor style changes ref. #16 --- README.md | 2 ++ patch/xresources.c | 10 +++++----- patches.def.h | 4 ++-- x.c | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9ad1ad1..13a3727 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the ### Changelog: +2021-05-07 - Added xresources reload patch + 2021-04-21 - Added (temporary?) hack for Variable Fonts (VT) support 2021-03-10 - Added sixel support diff --git a/patch/xresources.c b/patch/xresources.c index 52ac90d..32ab2be 100644 --- a/patch/xresources.c +++ b/patch/xresources.c @@ -34,15 +34,13 @@ resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst) return 0; } +void #if XRESOURCES_RELOAD_PATCH -void config_init(Display *dpy) -{ #else -void config_init(void) -{ #endif // XRESOURCES_RELOAD_PATCH +{ char *resm; XrmDatabase db; ResourcePref *p; @@ -62,7 +60,9 @@ config_init(void) } #if XRESOURCES_RELOAD_PATCH -void reload_config(int sig){ +void +reload_config(int sig) +{ /* Recreate a Display object to have up to date Xresources entries */ Display *dpy; if (!(dpy = XOpenDisplay(NULL))) diff --git a/patches.def.h b/patches.def.h index 4fdb3bd..6d1e95a 100644 --- a/patches.def.h +++ b/patches.def.h @@ -294,7 +294,7 @@ #define XRESOURCES_PATCH 0 /* This patch adds the ability to reload the Xresources config when a SIGUSR1 signal is received - e.g.: killall -USR1 st - Depends on the XRESOURCES_PATCH. + * e.g.: killall -USR1 st + * Depends on the XRESOURCES_PATCH. */ #define XRESOURCES_RELOAD_PATCH 0 diff --git a/x.c b/x.c index 77ab88b..9fd4a88 100644 --- a/x.c +++ b/x.c @@ -2576,7 +2576,7 @@ run: setlocale(LC_CTYPE, ""); XSetLocaleModifiers(""); - #if XRESOURCES_RELOAD_PATCH + #if XRESOURCES_RELOAD_PATCH && XRESOURCES_PATCH reload_config(-1); #elif XRESOURCES_PATCH if (!(xw.dpy = XOpenDisplay(NULL)))