You are not logged in.

#1 2012-07-02 13:11:58

Sotanaht
Member
Registered: 2012-01-14
Posts: 29

Using variables inside of .conkyrc to soft-code colors

I was setting up a .conkyrc file, and had an idea.  Instead of hard-coding the colors of each item, why not define some theme variables at the top of the script, like $headingcolor and $barcolor, and use something like

${color $headingcolor}

for all of my headings.  This way, if I decide I want to change all of my headings from, say, white to green, I can simply change

export headingcolor=white

to

export headingcolor=green

The only problem I found is that

${color $headingcolor}

doesn't actually work.  Instead I get a magenta color wherever I use it.

I thought at first that maybe the export command wasn't working, but I can do something like

export foo=bar
TEXT
${exec echo $foo}

and it displays "bar", so the issue has to be in using variables inside of something like ${color ___}.  It works with ${exec __}, but that might be special because it's exec, so I'm not sure that this is even possible.

Offline

#2 2012-07-02 15:18:25

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: Using variables inside of .conkyrc to soft-code colors

You can do something like:

default_color white
default_outline_color white
default_shade_color black
color0 gray
color1 ffffff
color2 green
color3 red
color4 blue
color5 magenta
color6 666666
color7 7f7f7f
color8 999999
color9 black

Check through the conky thread or the conky website documentation for more info and examples.

Offline

Board footer

Powered by FluxBB