[Xmonad] [dzen] Color support for arbitrary parts of the input

Robert Manea rob.manea at googlemail.com
Mon Jul 16 18:00:19 EDT 2007


I just added support for coloring arbitrary parts of a line to dzen.
Anyone who wants to give it a first try should grab the svn version:

    svn checkout http://dzen.googlecode.com/svn/trunk/ dzen

HEADS UP, the syntax has changed:

echo 'Default colors ^fg(blue)I'm blue ^bg(green)^fg(#ffffff)and I'm white on green' | dzen2 -p

As you see, you can place the ^fg(color) and ^bg(color) commands
anywhere into the text in any combination. The set colors will be used
until you define a new one on a per line basis (similar to terminal
escape seqs.)

Both commands accept either symbolic color names or #rrggbb hex-values.

If you need to display '^' characters just double them '^^' in order
to escape the special meaning.

The code is not perfect and I'll be happy to see some testing and
possible bug reports before release.

There is one known problem in menu mode, i.e. colored text will be
printed as is. I'll look into solving this issue in the next couple of

Bye, Rob.

P.S.: With this parsing method it is rather easily possible to support
      icons in dzen. So this will be a priority TODO as soon as the
      parser is stable and I found a suitable icon format.

More information about the Xmonad mailing list