Re: [dwm] patch for colored status text

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Sat, 6 Dec 2008 08:50:45 +0000

What about adding this patch to the wiki?

Kind regards,
Anselm

2008/12/4 Jeremy Jay <dinkumator_AT_gmail.com>:
> Another simple patch for anyone interested. Changes the way colors are
> defined slighty, allowing you to create more color combinations. Then,
> to color the status text from stdin you can simply use the color combo # as
> follows:
>
> echo -e "\x03 warning low battery" -- will be printed with the third color combo
> echo -e "\x04 danger will robinson" -- will be printed with the fourth color combo
> echo -e " normal text \x03 warning \x04 error \x01 normal again"
>
> For example, my colors in config.h are:
> #define NUMCOLORS 4
> static const char colors[NUMCOLORS][ColLast][8] = {
> // border foreground background
> { "#000033", "#dddddd", "#000033" }, // normal
> { "#000088", "#ffffff", "#000088" }, // selected
> { "#ff0000", "#000000", "#ffff00" }, // urgent/warning (black on yellow)
> { "#ff0000", "#ffffff", "#ff0000" }, // error (white on red)
> // add more here
> };
>
> Which, coupled with my own status script results in things like the attached image.
>
> Hope someone else finds this handy, I let my battery die one too many
> times because I never noticed how low it was...
>
> Jeremy
Received on Sat Dec 06 2008 - 08:50:45 UTC

This archive was generated by hypermail 2.2.0 : Sat Dec 06 2008 - 09:00:07 UTC