Re: chart label alternate font

Bill Wilson <[email protected]> Mon, 12 Sep 2016 19:01:38 -0500
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
On Mon, 12 Sep 2016 18:17:31 -0400
Jon LaBadie <[email protected]> wrote:

> On Mon, Sep 12, 2016 at 09:13:05AM -0500, Bill Wilson wrote:
> > The colors are part of the theme so you have to edit the gkrellmrc file for the theme
> > you are using.  Look for the lines:
> > 
> > StyleChart *.textcolor = #efd097 #000000 shadow
> > StyleChart *.alt_textcolor = #00e4e2 #000000 shadow
> > 
> > The path to  the theme you are using can be seen in the Config->Themes page.
> > But if you are using the default theme, you have to get the gkrellm source and copy
> > the pixmaps directory to a new theme.  For example in the top dir of the
> > gkrellm source tree:
> > 
> > cp -a pixmaps ~/.gkrellm2/themes/your_theme_name
> > 
> > Then edit ~/.gkrellm2/themes/your_theme_name/gkrellmrc
> > 
> > Or a new theme can be put in /usr/local/share/gkrellm2/themes/
> > 
> > Bill
> 
> Long ago I downloaded tons of themes and selected "trublu".  I haven't
> changed it since.
> 
> I just looked and yes those lines are in the gkrellmrc file for
> trublu, and they are the same color.  Maybe my memory is faulty.
> 
> While exploring, I noticed a new derivative theme, "TruBlu".  According
> to the README, there is just a minor change in files other than the "rc"
> file.  When I compared the two "rc" files, the TruBlu was identical
> except for the addition of these 3 lines:
> 
>   #large_font = "-adobe-courier-medium-r-normal-*-*-120-*-*-m-*-iso8859-1"
>   #normal_font = "-adobe-courier-medium-r-normal-*-*-100-*-*-m-*-iso8859-1"
>   #small_font   = "-adobe-helvetica-medium-r-normal-*-*-80-*-*-p-*-iso8859-1"
> 
> I realize they are comments, but it suggests there may be a possibility
> of 3 fonts or font sizes.  Is that the case?
> 
> Also, is there a way to select the alternate color separately from
> the alternate font?

Originally the three fonts (large, normal, small) were part of the theme, but that later
changed so that the user could set the fonts in Config->Themes.  So it's a relic for
those font lines in a gkrellmrc.  So you get two text colors per chart or panel set in
the gkrellmrc and two fonts per chart or panel set in the gkrellmrc out of a set of three
possible fonts set in the user config.

But each panel and chart can be configured differently so you
can get a variety of font colors.  For example:

StyleChart *.textcolor = #efd097 #000000 shadow
StyleChart *.alt_textcolor = #eee4e2 #000000 shadow
StyleChart disk.textcolor = #00d097 #000000 shadow
StyleChart disk.alt_textcolor = #00e4e2 #000000 shadow

StylePanel *.textcolor = #c8e4e2 #000000 shadow
StylePanel *.alt_textcolor = #e8e4d2 #000000 shadow
StylePanel disk.textcolor = #e40000 #000000 shadow
StylePanel disk.alt_textcolor = #00e400 #000000 shadow

Sets overall defaults and then custom colors for the disk monitor chart and panel.
Monitors that have a chart have a chart above a panel and use StyleChart and
StylePanel (eg disk, cpu, net).  Monitors that do not have a chart and are only a panel
are called meters and use StyleMeter (eg mail, fs).

To get the alt_textcolor in a panel, \f is not used and you have to use Pango markup
and use the $A variable in a Pango foreground attribute.  See the format strings
for the Clock monitor config->Clock->Options and read the Info page for that.

The reason for the difference in chart and panel text/color handling is that when gtk went
to Pango, that was used for the panels.  Text on charts is typically updated much more
frequently and is superimposed on chart pixmap data so that did not move to Pango for
performance reasons (I always want gkrellm to run well on slower machines).

Bill