aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/dmenu.c b/dmenu.c
index 97d0c90..357ba4f 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -26,7 +26,7 @@
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
/* enums */
-enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeOut, SchemeBorder, SchemeLast }; /* color schemes */
struct item {
char *text;
@@ -54,7 +54,7 @@ static Drw *drw;
static Clr *scheme[SchemeLast];
/* Temporary arrays to allow overriding xresources values */
-static char *colortemp[4];
+static char *colortemp[5];
static char *tempfonts;
#include "config.h"
@@ -722,7 +722,7 @@ setup(void)
CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
if (border_width)
- XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
+ XSetWindowBorder(dpy, win, scheme[SchemeBorder][ColFg].pixel);
XSetClassHint(dpy, win, &ch);
/* input methods */
@@ -784,6 +784,10 @@ readxresources(void) {
colors[SchemeSel][ColFg] = strdup(xval.addr);
else
colors[SchemeSel][ColFg] = strdup(colors[SchemeSel][ColFg]);
+ if (XrmGetResource(xdb, "dmenu.border", "*", &type, &xval))
+ colors[SchemeBorder][ColFg] = strdup(xval.addr);
+ else
+ colors[SchemeBorder][ColFg] = strdup(colors[SchemeBorder][ColFg]);
XrmDestroyDatabase(xdb);
}
@@ -852,13 +856,15 @@ main(int argc, char *argv[])
if ( tempfonts )
fonts[0] = strdup(tempfonts);
if ( colortemp[0])
- colors[SchemeNorm][ColBg] = strdup(colortemp[0]);
+ colors[SchemeNorm][ColBg] = strdup(colortemp[0]);
if ( colortemp[1])
- colors[SchemeNorm][ColFg] = strdup(colortemp[1]);
+ colors[SchemeNorm][ColFg] = strdup(colortemp[1]);
if ( colortemp[2])
- colors[SchemeSel][ColBg] = strdup(colortemp[2]);
+ colors[SchemeSel][ColBg] = strdup(colortemp[2]);
if ( colortemp[3])
- colors[SchemeSel][ColFg] = strdup(colortemp[3]);
+ colors[SchemeSel][ColFg] = strdup(colortemp[3]);
+ if ( colortemp[4])
+ colors[SchemeBorder][ColFg] = strdup(colortemp[4]);
if (!drw_fontset_create(drw, (const char**)fonts, LENGTH(fonts)))
die("no fonts could be loaded.");