commit 0fade9158a9d203f3a7077922ec5ede7bb0b805c
parent eed2984b7f34d9cc5b75c4925696a360cc36f26f
Author: bakkeby <bakkeby@gmail.com>
Date: Fri, 7 May 2021 09:27:05 +0200
xresources reload: minor style changes ref. #16
Diffstat:
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git 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
@@ -34,15 +34,13 @@ resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst)
return 0;
}
-#if XRESOURCES_RELOAD_PATCH
void
+#if XRESOURCES_RELOAD_PATCH
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
@@ -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
@@ -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)))