st-noxz

[fork] suckless st - personal fork
git clone git://git.noxz.tech/st-noxz
Log | Files | Refs | README | LICENSE

commit d64877b26ec2287b5d1b8176db81a15735159cec
parent 7c59d8ac3aa2a1af0bf368261997ff9578f10b4a
Author: Chris Noxz <chris@noxz.tech>
Date:   Wed, 14 Aug 2019 13:35:02 +0200

redraw st on signal

Diffstat:
Mconfig.def.h | 3+++
Mx.c | 12++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -8,6 +8,9 @@ static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; static int borderpx = 2; +/* redraw on signal */ +#define SIGREDRW SIGUSR1 + /* * What program is execed by st depends of these precedence rules: * 1: program passed with -e diff --git a/x.c b/x.c @@ -728,12 +728,24 @@ xloadcolor(int i, const char *name, Color *ncolor) } void +redraw_signalhandler(int signum) +{ + if (signum == SIGREDRW) { + xloadcols(); + redraw(); + xhints(); + } +} + +void xloadcols(void) { int i; static int loaded; Color *cp; + signal(SIGREDRW, &redraw_signalhandler); + if (loaded) { for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);