mirror of
https://github.com/mintycube/dotfiles.git
synced 2024-10-22 14:05:41 +02:00
35 lines
1.2 KiB
C
35 lines
1.2 KiB
C
#include <X11/Xresource.h>
|
|
|
|
void
|
|
readxresources(void)
|
|
{
|
|
XrmInitialize();
|
|
|
|
char* xrm;
|
|
if ((xrm = XResourceManagerString(drw->dpy))) {
|
|
char *type;
|
|
XrmDatabase xdb = XrmGetStringDatabase(xrm);
|
|
XrmValue xval;
|
|
|
|
if (XrmGetResource(xdb, "dmenu.font", "*", &type, &xval))
|
|
fonts[0] = strdup(xval.addr);
|
|
else
|
|
fonts[0] = strdup(fonts[0]);
|
|
if (XrmGetResource(xdb, "dmenu.background", "*", &type, &xval))
|
|
colors[SchemeNorm][ColBg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.foreground", "*", &type, &xval))
|
|
colors[SchemeNorm][ColFg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.selbackground", "*", &type, &xval))
|
|
colors[SchemeSel][ColBg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.selforeground", "*", &type, &xval))
|
|
colors[SchemeSel][ColFg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.outbackground", "*", &type, &xval))
|
|
colors[SchemeOut][ColBg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.outforeground", "*", &type, &xval))
|
|
colors[SchemeOut][ColFg] = strdup(xval.addr);
|
|
if (XrmGetResource(xdb, "dmenu.bordercolor", "*", &type, &xval))
|
|
colors[SchemeBorder][ColBg] = strdup(xval.addr);
|
|
XrmDestroyDatabase(xdb);
|
|
}
|
|
}
|