LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   conky question: passing conky-variable to shell-script (http://www.linuxquestions.org/questions/linux-software-2/conky-question-passing-conky-variable-to-shell-script-768525/)

zlin50 11-11-2009 06:31 PM

conky question: passing conky-variable to shell-script
 
Hi,

within my conkyrc I'm using the line

${execp ~/colorize.sh}${battery_bar 6,120 BAT0 }$color

colorize.sh evaluates state of charge and computes a color, giving e.g. "${color #b0ff00}" as output.

Now I would like to pass directly ${battery_percent} (which is available within conky) as input to colorize.sh - something like

${execp ~/colorize.sh ${battery_percent}}${battery_bar 6,120 BAT0 }$color

Obviously, the above version doesn't work.
What do I have to do?

Thx,
Markus

evan1026 12-29-2012 11:38 AM

I would really love an answer to this as well I'm actually trying to do pretty much the same thing so if anyone has an answer it would be nice to hear it

evan1026 12-29-2012 07:47 PM

Hey if you're still looking for something (although it's been a while, but I'm gonna post just in case) I found a command
Code:

acpi -b | egrep -o "[0-9]+%"
will return the same thing as $battery_percent, but with a percent sign, so you can use that and pass it to your shell script, just make sure you take care of the extra symbol.


All times are GMT -5. The time now is 04:57 AM.