darcs patch: Generalise the type of showDigits. (and 2 more)

Jose A. Ortega Ruiz jao at gnu.org
Wed Dec 8 07:43:30 EST 2010


Hi Petr,

On Wed, Dec 08 2010, Petr Rockai wrote:

> Hi,
>
> I am sending a couple of patches: the most important is the beefed up battery
> plugin, which is now able to display watts drawn and an estimate of time
> remaining. I have been using it for a while and it seems to work well. Feel
> free to report bugs in the new code to me, if this gets merged.

Thanks a lot for these patches! The first two are perfectly okay, and
the third one looks good, with a minor nit: it's not a good idea to
hardcode foreground colors in the monitor itself:

> +             Just True -> "<fc=green>On</fc>"
> +             Just False -> "<fc=red>Off</fc>"
> +       return $ if isNaN left then NA else Result left watts time acstr

> +       color x str | x >= 0 = "<fc=orange>" ++ str ++ "</fc>"
> +                   | x >= -10 = "<fc=green>" ++ str ++ "</fc>"
> +                   | x >= -12 = str
> +                   | otherwise = "<fc=red>" ++ str ++ "</fc>"

we should left those to the template.

I've moved xmobar's source to git (http://github.com/jaor/xmobar), and
the git repo is a bit ahead of the old darcs one, but i think i'll have
little problem in adapting your patches (unless you prefer to do that
yourself, which would be great :)). Once that's done, i will try them
and, eventually, make them official in a new release.

Thanks again, and sorry for the repo inconveniences!

Cheers,
jao



More information about the Xmobar mailing list