Re: [dev] [announce] wjt-0.1 - slider widget

From: Ian Remmler <ian_AT_remmler.org>
Date: Tue, 13 Dec 2016 21:10:22 -0600

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 $_AT_)
> 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.
Received on Wed Dec 14 2016 - 04:10:22 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 14 2016 - 04:12:18 CET