xresources reload: minor style changes ref. #16

This commit is contained in:
bakkeby 2021-05-07 09:27:05 +02:00
parent eed2984b7f
commit 0fade9158a
4 changed files with 10 additions and 8 deletions

View File

@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
### Changelog: ### Changelog:
2021-05-07 - Added xresources reload patch
2021-04-21 - Added (temporary?) hack for Variable Fonts (VT) support 2021-04-21 - Added (temporary?) hack for Variable Fonts (VT) support
2021-03-10 - Added sixel support 2021-03-10 - Added sixel support

View File

@ -34,15 +34,13 @@ resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst)
return 0; return 0;
} }
void
#if XRESOURCES_RELOAD_PATCH #if XRESOURCES_RELOAD_PATCH
void
config_init(Display *dpy) config_init(Display *dpy)
{
#else #else
void
config_init(void) config_init(void)
{
#endif // XRESOURCES_RELOAD_PATCH #endif // XRESOURCES_RELOAD_PATCH
{
char *resm; char *resm;
XrmDatabase db; XrmDatabase db;
ResourcePref *p; ResourcePref *p;
@ -62,7 +60,9 @@ config_init(void)
} }
#if XRESOURCES_RELOAD_PATCH #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 */ /* Recreate a Display object to have up to date Xresources entries */
Display *dpy; Display *dpy;
if (!(dpy = XOpenDisplay(NULL))) if (!(dpy = XOpenDisplay(NULL)))

View File

@ -294,7 +294,7 @@
#define XRESOURCES_PATCH 0 #define XRESOURCES_PATCH 0
/* This patch adds the ability to reload the Xresources config when a SIGUSR1 signal is received /* This patch adds the ability to reload the Xresources config when a SIGUSR1 signal is received
e.g.: killall -USR1 st * e.g.: killall -USR1 st
Depends on the XRESOURCES_PATCH. * Depends on the XRESOURCES_PATCH.
*/ */
#define XRESOURCES_RELOAD_PATCH 0 #define XRESOURCES_RELOAD_PATCH 0

2
x.c
View File

@ -2576,7 +2576,7 @@ run:
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
XSetLocaleModifiers(""); XSetLocaleModifiers("");
#if XRESOURCES_RELOAD_PATCH #if XRESOURCES_RELOAD_PATCH && XRESOURCES_PATCH
reload_config(-1); reload_config(-1);
#elif XRESOURCES_PATCH #elif XRESOURCES_PATCH
if (!(xw.dpy = XOpenDisplay(NULL))) if (!(xw.dpy = XOpenDisplay(NULL)))