As all the other colors are configurable by options, so should the
outbgcolor and outfgcolor.  While these colors are not usually visible
with one-off dmenus, it is nice have access to them for dmenu scripts
(especially vertical lists) for doing things with multiple menu items.

---
 config.def.h |  4 ++--
 dmenu.1      | 10 ++++++++++
 dmenu.c      |  7 ++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h
index c2a23fa..d0165b1 100644
--- a/config.def.h
+++ b/config.def.h
@@ -10,8 +10,8 @@ static const char *normbgcolor = "#222222"; /* -nb option; 
normal background
 static const char *normfgcolor = "#bbbbbb"; /* -nf option; normal foreground   
              */
 static const char *selbgcolor  = "#005577"; /* -sb option; selected background 
              */
 static const char *selfgcolor  = "#eeeeee"; /* -sf option; selected foreground 
              */
-static const char *outbgcolor  = "#00ffff";
-static const char *outfgcolor  = "#000000";
+static const char *outbgcolor  = "#00ffff"; /* -ob option; confirmed output 
background       */
+static const char *outfgcolor  = "#000000"; /* -of option; confirmed output 
foreground       */
 /* -l option; if nonzero, dmenu uses vertical list with given number of lines 
*/
 static unsigned int lines = 0;
 
diff --git a/dmenu.1 b/dmenu.1
index bbee17d..d61cf77 100644
--- a/dmenu.1
+++ b/dmenu.1
@@ -22,6 +22,10 @@ dmenu \- dynamic menu
 .IR color ]
 .RB [ \-sf
 .IR color ]
+.RB [ \-ob
+.IR color ]
+.RB [ \-of
+.IR color ]
 .RB [ \-v ]
 .P
 .BR dmenu_run " ..."
@@ -75,6 +79,12 @@ defines the selected background color.
 .BI \-sf " color"
 defines the selected foreground color.
 .TP
+.BI \-ob " color"
+defines the confirmed output background color.
+.TP
+.BI \-of " color"
+defines the confirmed output foreground color.
+.TP
 .B \-v
 prints version information to stdout, then exits.
 .SH USAGE
diff --git a/dmenu.c b/dmenu.c
index 8d9bbb6..2ff29c0 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -99,6 +99,10 @@ main(int argc, char *argv[]) {
                        selbgcolor = argv[++i];
                else if(!strcmp(argv[i], "-sf"))  /* selected foreground color 
*/
                        selfgcolor = argv[++i];
+               else if(!strcmp(argv[i], "-ob"))  /* confirmed output 
background color */
+                       outbgcolor = argv[++i];
+               else if(!strcmp(argv[i], "-of"))  /* confirmed output 
foreground color */
+                       outfgcolor = argv[++i];
                else
                        usage();
 
@@ -620,6 +624,7 @@ setup(void) {
 void
 usage(void) {
        fputs("usage: dmenu [-b] [-f] [-i] [-l lines] [-p prompt] [-fn font] 
[-m monitor]\n"
-             "             [-nb color] [-nf color] [-sb color] [-sf color] 
[-v]\n", stderr);
+             "             [-nb color] [-nf color] [-sb color] [-sf color]\n"
+             "             [-ob color] [-of color] [-v]\n", stderr);
        exit(EXIT_FAILURE);
 }
-- 
1.9.2

Reply via email to