mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
22 lines
1.0 KiB
C
22 lines
1.0 KiB
C
|
#include <X11/Xresource.h>
|
||
|
|
||
|
#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \
|
||
|
if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \
|
||
|
int i = 1; \
|
||
|
for (; i <= 6; i++) { \
|
||
|
if (value.addr[i] < 48) break; \
|
||
|
if (value.addr[i] > 57 && value.addr[i] < 65) break; \
|
||
|
if (value.addr[i] > 70 && value.addr[i] < 97) break; \
|
||
|
if (value.addr[i] > 102) break; \
|
||
|
} \
|
||
|
if (i == 7) { \
|
||
|
strncpy(V, value.addr, 7); \
|
||
|
V[7] = '\0'; \
|
||
|
} \
|
||
|
} \
|
||
|
}
|
||
|
|
||
|
static void loadxrdb(void);
|
||
|
static void xrdb(const Arg *arg);
|
||
|
|