diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-05-31 23:18:53 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-05-31 23:18:53 +0200 |
commit | f4d516ba8c6f799ce01dd98456e274ae21e596bd (patch) | |
tree | 17f8bc2fda4991870df9ce0ca6bc24dca586ebda /dmenu.c | |
parent | 8f7fe608601121d7c4ed9db792eb81c734bff882 (diff) | |
download | dmenu-f4d516ba8c6f799ce01dd98456e274ae21e596bd.tar.gz dmenu-f4d516ba8c6f799ce01dd98456e274ae21e596bd.tar.bz2 dmenu-f4d516ba8c6f799ce01dd98456e274ae21e596bd.zip |
update
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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."); |