On Wed, Dec 14, 2016 at 03:01:14AM +0100, mikan wrote:
> It's hard hard to share option flags between dmenu and wjt (with $@)
> because some of them are slightly different.
> 
> wjt uses more colors, so I'm not sure what could be done to match
> color options to dmenu in a non-sucky way, but could you at least
> change -f to -fn for font?

The other suckless tools don't all share the same option names, so I
didn't consider it too important.  st uses -f for font, for instance.  I
like that wjt's two-letter options are thing/subthing, and -fn wouldn't
fit that pattern.

What I did was create a "theme" include file that defines variables for
fonts and colors, and my config.h files include that and use the
variables where appropriate.

Some excerpts to show you what I mean:

~/src/suckless/config.h:

        static const char normal_bg[] = "#5f5f5f";
        static const char normal_fg[] = "#dfdfdf";
        static const char select_fg[] = "#000000";
        static const char select_bg[] = "#9f9fdf";
        static const char font[]      = "Inconsolata:size=12";

~/src/suckless/dmenu/config.h:

        #include "../config.h"
        static const char *fonts[] = { font };
        static const char *colors[SchemeLast][2] = {
                [SchemeNorm] = { normal_fg, normal_bg },
                [SchemeSel]  = { select_fg, select_bg },
                [SchemeOut]  = { normal_bg, normal_fg },
        };

~/src/suckless/wjt/config.h:

        #include "../config.h"
        static const char *fonts[] = { font };
        static const char *colors[SchemeLast][2] = {
                [SchemePrompt] = { select_fg, select_bg },
                [SchemeSlider] = { select_fg, normal_bg },
                [SchemeValue]  = { select_fg, select_bg },
        };

-- 
        - Ian.

Reply via email to