From 02b0204292f0fc84c03db6476fd31a1e419a9c9e Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Mon, 28 Jun 2021 22:00:09 -0400 Subject: [PATCH] Remove unnecesary highlight color options --- config.h | 2 -- dmenu.1 | 20 -------------------- dmenu.c | 17 +++-------------- 3 files changed, 3 insertions(+), 36 deletions(-) diff --git a/config.h b/config.h index b4d27d9..1f8ab95 100644 --- a/config.h +++ b/config.h @@ -12,8 +12,6 @@ static const char *colors[SchemeLast][2] = { // fg bg [SchemeNorm] = { "#000000", "#ffffff" }, [SchemeSel] = { "#ffffff", "#000000" }, - [SchemeSelHighlight] = { "#ffc978", "#000000" }, - [SchemeNormHighlight] = { "#000000", "#ffffff" }, [SchemeOut] = { "#000000", "#00ffff" }, }; /* -l option; if nonzero, dmenu uses vertical list with given number of lines */ diff --git a/dmenu.1 b/dmenu.1 index 90aa7b5..762f707 100644 --- a/dmenu.1 +++ b/dmenu.1 @@ -20,14 +20,6 @@ dmenu \- dynamic menu .IR color ] .RB [ \-sf .IR color ] -.RB [ \-nhb -.IR color ] -.RB [ \-nhf -.IR color ] -.RB [ \-shb -.IR color ] -.RB [ \-shf -.IR color ] .RB [ \-w .IR windowid ] .P @@ -86,18 +78,6 @@ defines the selected background color. .BI \-sf " color" defines the selected foreground color. .TP -.BI \-nhb " color" -defines the normal highlight background color. -.TP -.BI \-nhf " color" -defines the normal highlight foreground color. -.TP -.BI \-shb " color" -defines the selected highlight background color. -.TP -.BI \-shf " color" -defines the selected highlight foreground color. -.TP .B \-v prints version information to stdout, then exits. .TP diff --git a/dmenu.c b/dmenu.c index e22e054..1560b60 100644 --- a/dmenu.c +++ b/dmenu.c @@ -29,8 +29,7 @@ #define NUMBERSBUFSIZE (NUMBERSMAXDIGITS * 2) + 1 /* enums */ -enum { SchemeNorm, SchemeSel, SchemeNormHighlight, SchemeSelHighlight, - SchemeOut, SchemeLast }; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ struct item { @@ -130,9 +129,7 @@ drawhighlights(struct item *item, int x, int y, int maxw) if (!(strlen(item->text) && strlen(text))) return; - drw_setscheme(drw, scheme[item == sel - ? SchemeSelHighlight - : SchemeNormHighlight]); + drw_setscheme(drw, scheme[item == sel ? SchemeSel : SchemeNorm]); for (i = 0, highlight = item->text; *highlight && text[i];) { if (*highlight == text[i]) { /* get indentation */ @@ -854,7 +851,7 @@ usage(void) { fputs("usage: dmenu [-bfivP] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" " [-nb color] [-nf color] [-sb color] [-sf color]\n" - " [-nhb color] [-nhf color] [-shb color] [-shf color] [-w windowid]\n", stderr); + " [-w windowid]\n", stderr); exit(1); } @@ -899,14 +896,6 @@ main(int argc, char *argv[]) colors[SchemeSel][ColBg] = argv[++i]; else if (!strcmp(argv[i], "-sf")) /* selected foreground color */ colors[SchemeSel][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-nhb")) /* normal hi background color */ - colors[SchemeNormHighlight][ColBg] = argv[++i]; - else if (!strcmp(argv[i], "-nhf")) /* normal hi foreground color */ - colors[SchemeNormHighlight][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-shb")) /* selected hi background color */ - colors[SchemeSelHighlight][ColBg] = argv[++i]; - else if (!strcmp(argv[i], "-shf")) /* selected hi foreground color */ - colors[SchemeSelHighlight][ColFg] = argv[++i]; else if (!strcmp(argv[i], "-w")) /* embedding window id */ embed = argv[++i]; else -- 2.39.2