Conky/Dzen2 and variables from shell

985 Views Asked by At

I'm trying to make some dzen2 stuff, but i have some hard time on one point. I want to eval color variable between conky and dzen2.

Something like that:

Colors :

#!/bin/zsh

#################################
## Colors for Dzen2 status bar ##
#################################

##
## TEST Colors
##
COLOR_TEST='#000000'

Conkyrc :

#################################
## Conky for Dzen2 Status Bar  ##
#################################

background no
out_to_console yes
out_to_x no
override_utf8_locale yes
update_interval 1
total_run_times 0

TEXT
##
##  TEST
##
  ^fg($$COLOR_TEST)

Script:

#!/bin/zsh

. ./colors
conky -c conkyrc | dzen2 -p

I tried eval/echo on conky, but nothing sucessfull. If somebody have an idea, it will be really nice.

Thanks anyway

Have a good day


EDIT:

If we can't find a solution about the main question, what's the best idea?

  • Lua/Conky (I think it's not bad)
  • Shell/Dzen2 (Performance are not amazing last time i tried that)
  • A full program in C++ (A little overkill, and conky is generic)
3

There are 3 best solutions below

4
On BEST ANSWER

How about to use ${execp my-dzen-help.sh getcolors }, in conky ?

#my-dzen-help.sh

getcolors(){
printf '^fg($$COLOR_TEST)'; # or what ....
}
0
On

After some thinking i come to a conclusion : create some tools like conky/dzen2 from scratch. Like this i'll have something ready for wayland and more easy to use.

So i'll try to get some time to make it, the most important part will be "dzen2" with glfw/opengl.

-

But if somebody find an answer for the original question, i'm still curious !

0
On

i dont know about dzen, and i dont use zsh, but i use lemonbar, and i use this, to pass some special UTF-8 chars, to my lemonbar through conky :

${exec /bin/bash -c 'echo -en "%{T3}\\uf012%{T-}"'}

maybe this, gives you an idea, how to parse-out, variables, from inside a script.